Browse Source

更新卫健&集成电路后台权限

zmw 1 tháng trước cách đây
mục cha
commit
24919f82e6

+ 2 - 0
app/Admin/Controllers/Company/CompanyController.php

@@ -221,6 +221,8 @@ class CompanyController extends Controller
             $query->where('subsite_id', get_subsite_id());
         })->when(Admin::user()->isRole('health'), function ($query) {
             $query->where('is_health',1);
+        })->when(Admin::user()->isRole('ic_group'), function ($query) {
+            $query->where('is_ic',1);
         })->orderByRaw("field(audit,2,1,3,0)")->orderBy('id', 'desc');
 
         $grid->id('ID');

+ 2 - 0
app/Admin/Controllers/Company/JobsController.php

@@ -166,6 +166,8 @@ ETO;
             $query->where('subsite_id', get_subsite_id());
         })->when(Admin::user()->isRole('health'), function ($query) {
             $query->where('is_health',1);
+        })->when(Admin::user()->isRole('ic_group'), function ($query) {
+            $query->where('is_ic',1);
         })->orderByRaw("field(audit,2,1,3,0)")->orderBy('id', 'desc');
 
         $grid->id('id');

+ 5 - 0
app/Admin/Controllers/Content/ArticleController.php

@@ -10,6 +10,7 @@ use App\Models\ArticleProperty;
 use App\Models\Subsite;
 use App\Models\SubsiteArticle;
 use Encore\Admin\Controllers\HasResourceActions;
+use Encore\Admin\Facades\Admin;
 use Encore\Admin\Facades\Admin as userAdmin;
 use Encore\Admin\Form;
 use Encore\Admin\Grid;
@@ -92,6 +93,10 @@ class ArticleController extends Controller
 
         $grid->model()->when(get_subsite_id()>0, function ($query) {
             $query->where('subsite_id', get_subsite_id());
+        })->when(Admin::user()->isRole('health'), function ($query) {
+            $query->whereIn('type_id',[65,66]);
+        })->when(Admin::user()->isRole('ic_group'), function ($query) {
+            $query->where('type_id',67);
         })->orderBy('list_order', 'DESC')->orderBy('created_at', 'DESC');
 
         $grid->column('新闻标题')->display(function () {

+ 1 - 1
app/Admin/Controllers/Health/IndexController.php

@@ -372,7 +372,7 @@ class IndexController extends Controller
     }
 
     public function postStatus(Request $request){
-
+        Permission::check('postInfoList');
         $info = PostAppoint::where(['id' => $request->id])->first();
         if($info){
             $info->status = 1;