|
|
|
|
@ -40,7 +40,7 @@ class OrdersController extends CommonController
|
|
|
|
|
$month = request()->month ?? '全部';
|
|
|
|
|
$months = (new OrdersController())->_getMonths();
|
|
|
|
|
|
|
|
|
|
if($month != '全部'){
|
|
|
|
|
if ($month != '全部') {
|
|
|
|
|
$start_timestamp = strtotime($month);
|
|
|
|
|
$end_timestamp = strtotime("+1 month", strtotime($month));
|
|
|
|
|
$this->model = $this->model->whereRaw("UNIX_TIMESTAMP(`created_at`) >= " . $start_timestamp . " and UNIX_TIMESTAMP(`created_at`) < " . $end_timestamp);
|
|
|
|
|
@ -60,6 +60,13 @@ class OrdersController extends CommonController
|
|
|
|
|
$roleId = Role::where('name', 'like', '%护士长%')->where('guard_name', 'admin')->value('id');
|
|
|
|
|
$hushizhang = DB::table('model_has_roles')->where('role_id', $roleId)
|
|
|
|
|
->where('model_type', 'App\Admin')->where('model_id', $userId)->count();
|
|
|
|
|
|
|
|
|
|
// 是否院方管理
|
|
|
|
|
$roleId = Role::where('name', 'like', '%院方管理%')->where('guard_name', 'admin')->value('id');
|
|
|
|
|
$yuanfang = DB::table('model_has_roles')->where('role_id', $roleId)
|
|
|
|
|
->where('model_type', 'App\Admin')->where('model_id', $userId)->count();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($hushizhang) {
|
|
|
|
|
$user = auth()->user();
|
|
|
|
|
$areaId = AdminAreaLink::where('project_id', $project_id)->where('admin_id', $user->id)->pluck('area_id');
|
|
|
|
|
@ -111,7 +118,7 @@ class OrdersController extends CommonController
|
|
|
|
|
'20' => '进行中',
|
|
|
|
|
'100' => '已完成'
|
|
|
|
|
];
|
|
|
|
|
return view($this->bladePath . ".index", compact("status", "data", "project_id", "month", "project", "hushizhang", "order_status_list"));
|
|
|
|
|
return view($this->bladePath . ".index", compact("status", "data", "project_id", "month", "project", "hushizhang", "yuanfang", "order_status_list"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function _getMonths()
|
|
|
|
|
|