|
@@ -38,6 +38,8 @@ class ViolationStore extends Controller
|
|
|
$end_time = request('end_time', '');
|
|
$end_time = request('end_time', '');
|
|
|
$store_name = request('store_name', '');
|
|
$store_name = request('store_name', '');
|
|
|
$store_type = request('store_type', '');//店铺类型:1=黑名单2=白名单
|
|
$store_type = request('store_type', '');//店铺类型:1=黑名单2=白名单
|
|
|
|
|
+ $platforms = request('platforms', '');//平台
|
|
|
|
|
+ $employee_ids = request('employee_ids', '');//员工ID
|
|
|
// 时间条件
|
|
// 时间条件
|
|
|
if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
|
|
if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
|
|
|
if ($end_time) $map[] = ['insert_time', '<=', strtotime($end_time)];
|
|
if ($end_time) $map[] = ['insert_time', '<=', strtotime($end_time)];
|
|
@@ -51,7 +53,23 @@ class ViolationStore extends Controller
|
|
|
}else{
|
|
}else{
|
|
|
$map[] = ['company_id', '=', $admin_company_id];
|
|
$map[] = ['company_id', '=', $admin_company_id];
|
|
|
}
|
|
}
|
|
|
- $result = $ViolationStoreModel->query()
|
|
|
|
|
|
|
+ if (!empty($platforms) && $platforms != '') {
|
|
|
|
|
+ $platforms = explode(',', $platforms);
|
|
|
|
|
+ foreach ($platforms as $platform) {
|
|
|
|
|
+ if(empty($platform) || $platform == '') continue;
|
|
|
|
|
+ $ViolationStoreModel = $ViolationStoreModel
|
|
|
|
|
+ ->whereRaw("FIND_IN_SET(?, platform)", [$platform]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!empty($employee_ids) && $employee_ids != '') {
|
|
|
|
|
+ $employee_ids = explode(',', $employee_ids);
|
|
|
|
|
+ foreach ($employee_ids as $employee_id) {
|
|
|
|
|
+ if(empty($employee_id) || $employee_id == '') continue;
|
|
|
|
|
+ $ViolationStoreModel = $ViolationStoreModel
|
|
|
|
|
+ ->whereRaw("FIND_IN_SET(?, employee_ids)", [$employee_id]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $result = $ViolationStoreModel
|
|
|
->where($map)
|
|
->where($map)
|
|
|
->orderByDesc('id')
|
|
->orderByDesc('id')
|
|
|
->paginate($limit)->toarray();
|
|
->paginate($limit)->toarray();
|