|
@@ -145,14 +145,18 @@ class MembersSetmealController extends Controller
|
|
$grid->model()->where('utype', 1)->whereHas('companys')->when(get_subsite_id()>0, function ($querys) {
|
|
$grid->model()->where('utype', 1)->whereHas('companys')->when(get_subsite_id()>0, function ($querys) {
|
|
$querys->whereHas('companys', function ($query) {
|
|
$querys->whereHas('companys', function ($query) {
|
|
$query->where('subsite_id', get_subsite_id());
|
|
$query->where('subsite_id', get_subsite_id());
|
|
- if(Admin::user()->isRole('health')){
|
|
|
|
- $query->where('is_health',1);
|
|
|
|
- }
|
|
|
|
- if(Admin::user()->isRole('ic_group')){
|
|
|
|
- $query->where('is_ic',1);
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ })->when(Admin::user()->isRole('health'), function ($querys) {
|
|
|
|
+ $querys->whereHas('companys', function ($query) {
|
|
|
|
+ $query->where('is_health',1);
|
|
|
|
+ });
|
|
|
|
+ })->when(Admin::user()->isRole('ic_group'), function ($querys) {
|
|
|
|
+ $querys->whereHas('companys', function ($query) {
|
|
|
|
+ $query->where('is_ic',1);
|
|
});
|
|
});
|
|
})->orderBy('id', 'desc');
|
|
})->orderBy('id', 'desc');
|
|
|
|
+
|
|
|
|
+
|
|
$grid->setmeal_name('套餐名称');
|
|
$grid->setmeal_name('套餐名称');
|
|
$grid->column('companys.companyname', '公司名称');
|
|
$grid->column('companys.companyname', '公司名称');
|
|
$grid->column('companys.username', '用户名称');
|
|
$grid->column('companys.username', '用户名称');
|