|
|
|
@ -29,10 +29,11 @@ class WorkorderController extends AdminController |
|
|
|
public function index(Content $content) |
|
|
|
{ |
|
|
|
$workorderId = \request('workorder_id',0); |
|
|
|
$data = $userList = $msgList = []; |
|
|
|
$userList = $msgList = []; |
|
|
|
$workorder = \App\Models\Workorder::query() |
|
|
|
->with('point') |
|
|
|
->with(['point','publisher']) |
|
|
|
->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') |
|
|
|
->get(); |
|
|
|
|
|
|
|
@ -41,8 +42,8 @@ class WorkorderController extends AdminController |
|
|
|
$arr = [ |
|
|
|
'workorder_id' => $v->id, |
|
|
|
'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, |
|
|
|
'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '', |
|
|
|
'last_message_time' => $item->created_at ?? '', |
|
|
|
@ -73,8 +74,8 @@ class WorkorderController extends AdminController |
|
|
|
]; |
|
|
|
|
|
|
|
return $content |
|
|
|
->header('Dashboard') |
|
|
|
->description('Description...') |
|
|
|
->header('工单') |
|
|
|
->description('列表') |
|
|
|
->body(admin_view('admin.pages.index',$data)); |
|
|
|
} |
|
|
|
|
|
|
|
|