|
@@ -120,15 +120,14 @@ class ViolationProduct extends Api
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
// 查询数据
|
|
// 查询数据
|
|
|
- $map1 = array_merge($map, [['first_responsible_person', 'like',"%,$user_id,%"]]);
|
|
|
|
|
- $map2 = array_merge($map, [['responsible_person', 'like',"%,$user_id,%"]]);
|
|
|
|
|
- $map3 = array_merge($map, [['source_responsible_person', 'like',"%,$user_id,%"]]);
|
|
|
|
|
- $result = $ViolationProductModel
|
|
|
|
|
- ->where($map1)
|
|
|
|
|
- ->orWhere($map2)
|
|
|
|
|
- ->orWhere($map3)
|
|
|
|
|
- ->orderByDesc('id')
|
|
|
|
|
- ->paginate($limit)->toarray();
|
|
|
|
|
|
|
+ $result = $ViolationProductModel->where($map)->where(function ($q) use ($user_id) {
|
|
|
|
|
+ $q->where('first_responsible_person', 'like', "%,$user_id,%")
|
|
|
|
|
+ ->orWhere('responsible_person', 'like', "%,$user_id,%")
|
|
|
|
|
+ ->orWhere('source_responsible_person', 'like', "%,$user_id,%");
|
|
|
|
|
+ })
|
|
|
|
|
+ ->orderByDesc('id')
|
|
|
|
|
+ ->paginate($limit)
|
|
|
|
|
+ ->toArray();
|
|
|
// 分配数据
|
|
// 分配数据
|
|
|
if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
|
if (isset($result['data']) && count($result['data']) > 0) {
|
|
if (isset($result['data']) && count($result['data']) > 0) {
|