|
|
|
|
@ -12,6 +12,7 @@ use App\Customer;
|
|
|
|
|
use App\Libs\AlipayF2F;
|
|
|
|
|
use App\Libs\WxMicroPay;
|
|
|
|
|
use App\Models\AdminAreaLink;
|
|
|
|
|
use App\Models\Area;
|
|
|
|
|
use App\Models\Balance;
|
|
|
|
|
use App\Models\Bed;
|
|
|
|
|
use App\Models\Factor;
|
|
|
|
|
@ -376,4 +377,34 @@ class StatisticsController extends CommonController
|
|
|
|
|
$res = (new AlipayF2F())->manualQuery($recharge);
|
|
|
|
|
dd($res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function huli(Request $request)
|
|
|
|
|
{
|
|
|
|
|
$projects = (new StatisticsController())->_checkProjects();
|
|
|
|
|
$defaultProjectsId = ($projects[0]->id) ?? '';
|
|
|
|
|
$project_id = $request->get('project_id', $defaultProjectsId);
|
|
|
|
|
|
|
|
|
|
$userId = auth()->id();
|
|
|
|
|
// 判断是否护士长
|
|
|
|
|
$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();
|
|
|
|
|
$areaId = [];
|
|
|
|
|
if ($hushizhang) {
|
|
|
|
|
$user = auth()->user();
|
|
|
|
|
$areaId = AdminAreaLink::where(function ($qeury) use ($project_id) {
|
|
|
|
|
if ($project_id) {
|
|
|
|
|
$qeury->where('project_id', $project_id);
|
|
|
|
|
}
|
|
|
|
|
})->where('admin_id', $user->id)->pluck('area_id');
|
|
|
|
|
}
|
|
|
|
|
$data = Area::where(function ($query) use ($areaId) {
|
|
|
|
|
if ($areaId) {
|
|
|
|
|
$query->whereIn('id', $areaId);
|
|
|
|
|
}
|
|
|
|
|
})->get();
|
|
|
|
|
return view($this->bladePath . ".huli", compact("data"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|