|
|
@@ -53,6 +53,43 @@ class ViolationStore extends Controller
|
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 全部
|
|
|
+ * @author 唐远望
|
|
|
+ * @version 1.0
|
|
|
+ * @date 2025-12-08
|
|
|
+ *
|
|
|
+ */
|
|
|
+ public function all(Request $request, ViolationStoreModel $ViolationStoreModel)
|
|
|
+ {
|
|
|
+ $request->scene('all')->validate();
|
|
|
+ // 查询条件
|
|
|
+ $map = [];
|
|
|
+ $status = request('status', '0');
|
|
|
+ $start_time = request('start_time', '');
|
|
|
+ $end_time = request('end_time', '');
|
|
|
+ $store_name = request('store_name', '');
|
|
|
+ $company_name = request('company_name', '');
|
|
|
+ $social_credit_code = request('social_credit_code', '');
|
|
|
+ // 时间条件
|
|
|
+ if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
|
|
|
+ if ($end_time) $map[] = ['insert_time', '<=', strtotime($end_time)];
|
|
|
+ // 其他条件
|
|
|
+ if (is_numeric($status)) $map[] = ['status', '=', $status];
|
|
|
+ if ($social_credit_code) $map[] = ['social_credit_code', 'like', "%$social_credit_code%"];
|
|
|
+ if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
|
|
|
+ if ($store_name) $map[] = ['store_name', 'like', "%$store_name%"];
|
|
|
+ // 查询数据
|
|
|
+ $result = $ViolationStoreModel->query()
|
|
|
+ ->where($map)
|
|
|
+ ->orderByDesc('id')
|
|
|
+ ->get();
|
|
|
+ // 分配数据
|
|
|
+ if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
|
+ // 加载模板
|
|
|
+ return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 详情
|
|
|
* @author 唐远望
|