Browse Source

细节

develop
lemon 4 years ago
parent
commit
33b108a90d
  1. 13
      app/AdminAgent/Controllers/WorkorderController.php
  2. 2
      resources/views/admin/pages/index.blade.php

13
app/AdminAgent/Controllers/WorkorderController.php

@ -29,10 +29,11 @@ class WorkorderController extends AdminController
public function index(Content $content) public function index(Content $content)
{ {
$workorderId = \request('workorder_id',0); $workorderId = \request('workorder_id',0);
$data = $userList = $msgList = [];
$userList = $msgList = [];
$workorder = \App\Models\Workorder::query() $workorder = \App\Models\Workorder::query()
->with('point')
->with(['point','publisher'])
->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[0]]) ->where(['publisher_id' => Admin::user()->id,'publisher_type' => DemandTraits::$col[0]])
->orWhere(['point_id' => Admin::user()->id,'point_type' => DemandTraits::$col[0]])
->orderByDesc('updated_at') ->orderByDesc('updated_at')
->get(); ->get();
@ -41,8 +42,8 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'workorder_id' => $v->id, 'workorder_id' => $v->id,
'unread' => true, 'unread' => true,
'avatar' => $v->point->avatar,
'name' => $v->point->name,
'avatar' => $v->publisher_type == DemandTraits::$col[0] ? $v->point->avatar : $v->publisher->avatar,
'name' => $v->publisher_type == DemandTraits::$col[0] ? $v->point->name : $v->publisher->name,
'content' => $v->title, 'content' => $v->title,
'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '', 'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '',
'last_message_time' => $item->created_at ?? '', 'last_message_time' => $item->created_at ?? '',
@ -73,8 +74,8 @@ class WorkorderController extends AdminController
]; ];
return $content return $content
->header('Dashboard')
->description('Description...')
->header('工单')
->description('列表')
->body(admin_view('admin.pages.index',$data)); ->body(admin_view('admin.pages.index',$data));
} }

2
resources/views/admin/pages/index.blade.php

@ -30,7 +30,7 @@
position: absolute; right: 5px; top: 5px; position: absolute; right: 5px; top: 5px;
width: 10px; height: 10px; border-radius: 10px; width: 10px; height: 10px; border-radius: 10px;
} }
.background-red { background-color: red; }
/*.background-red { background-color: red; }*/
.background-gray { background-color: gray; } .background-gray { background-color: gray; }
</style> </style>

Loading…
Cancel
Save