cody 2 years ago
parent d8475c57c6
commit 3e21c5b77f

@ -105,7 +105,13 @@ class HomeController extends CommonController
'total' => (new Orders())->ofProject($project_id)->where('created_at', 'like', $month . '%')->count() 'total' => (new Orders())->ofProject($project_id)->where('created_at', 'like', $month . '%')->count()
]; ];
} }
if (is_mobile()) { // 判断是否有权限
$userId = auth()->id();
$roleId = Role::where('name', 'like', '%首页统计%')->where('guard_name', 'admin')->value('id');
$tongji = DB::table('model_has_roles')->where('role_id', $roleId)
->where('model_type', 'App\Admin')->where('model_id', $userId)->count();
if (is_mobile() || empty($tongji)) {
return view($this->bladePath . ".mobile_home"); return view($this->bladePath . ".mobile_home");
} else { } else {
return view($this->bladePath . ".home", compact('counts', 'lies', 'saleList', 'orderList')); return view($this->bladePath . ".home", compact('counts', 'lies', 'saleList', 'orderList'));

@ -237,6 +237,9 @@
@endpush @endpush
@section("content") @section("content")
@foreach($projects as $project) @foreach($projects as $project)
<select class="hospital-select" name="hospital-select"> <select class="hospital-select" name="hospital-select">
<option value="{{$project->id}}">{{$project->name}}</option> <option value="{{$project->id}}">{{$project->name}}</option>

Loading…
Cancel
Save