修复了滚动栏的bug,消息未解决

This commit is contained in:
yuki
2017-06-17 12:14:51 +08:00
parent 20ebce97f4
commit 780eb1b828
6 changed files with 47 additions and 41 deletions
+3 -3
View File
@@ -29,9 +29,9 @@ class AdminController extends Controller
$data['users'] = User::orderby('id', 'asc')->get();
$data['cats'] = GoodCat::orderby('cat_name', 'asc')->get();
$data['announcements'] = Announcement::orderby('id', 'dsc')->get();
$data['reports'] = Ticket::where('type', '2')->orderby('id', 'dsc')->paginate(16);
$data['users'] = User::orderby('id', 'asc')->paginate(16);
$data['trans'] = Transaction::orderby('id', 'asc')->paginate(16);
$data['reports'] = Ticket::where('type', '2')->orderby('id', 'dsc')->paginate(40);
$data['users'] = User::orderby('id', 'asc')->paginate(40);
$data['trans'] = Transaction::orderby('id', 'asc')->paginate(40);
return View::make('admin.index')->with($data);
}
+10 -10
View File
@@ -23,6 +23,16 @@ class MessageController extends Controller
{
public function showMessageView(Request $request)
{
$user_id = $request->session()->get('user_id');
$post_data = 'user_id='.$user_id.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '127.0.0.1:6565/notify');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
curl_close($ch);
return View::make('message.message');
}
@@ -39,16 +49,6 @@ class MessageController extends Controller
MessageContact::where('user_id', $user_id)
->where('contact_id', $contact_id)
->update(['unread_count' => 0]);
$user_id = $request->session()->get('user_id');
$post_data = 'user_id='.$user_id.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '127.0.0.1:6565/notify');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
curl_close($ch);
return json_encode($messages);
}
+2 -1
View File
@@ -20,7 +20,8 @@ class Transaction extends Model
public function getSellerIdAttribute()
{
return $this->good->user_id;
if($this->good != NULL)
return $this->good->user_id;
}
public function seller()
+2 -2
View File
@@ -38,9 +38,9 @@ class User extends Model
{
$len=strlen($this->stuid);
$ans = "";
$ans = $ans . ($this->stuid)[0];
$ans = $ans . substr($this->stuid, 0, 1);
for($i=1; $i<($len-1); $i++) $ans = $ans . '*';
$ans = $ans . ($this->stuid)[$len-1];
$ans = $ans . substr($this->stuid, -1);
return $ans;
}