|
|
|
|
@ -167,6 +167,7 @@ class StatisticsController extends CommonController
|
|
|
|
|
|
|
|
|
|
$start_timestamp = strtotime($month);
|
|
|
|
|
$end_timestamp = strtotime("+1 month", strtotime($month));
|
|
|
|
|
|
|
|
|
|
//根据项目获取相关数据
|
|
|
|
|
$prev_month_balance = Balance::whereRaw("UNIX_TIMESTAMP(`created_at`) < " . $start_timestamp)
|
|
|
|
|
->whereHas("order", function ($query) use ($project_id) {
|
|
|
|
|
@ -246,14 +247,14 @@ class StatisticsController extends CommonController
|
|
|
|
|
->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();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取这个护士长病区的订单或院方管理楼栋的订单
|
|
|
|
|
$user = auth()->user();
|
|
|
|
|
$orderIds = [];
|
|
|
|
|
@ -424,13 +425,13 @@ class StatisticsController extends CommonController
|
|
|
|
|
$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();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$areaId = [];
|
|
|
|
|
$buildingId = [];
|
|
|
|
|
if ($hushizhang) {
|
|
|
|
|
|