From e85be75bc6ce542b57d1e5f2dddae82ba92ea8c3 Mon Sep 17 00:00:00 2001 From: zhaocheng <578322713@qq.com> Date: Fri, 9 Sep 2022 12:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B8=85=E9=99=A4=E7=94=B5?= =?UTF-8?q?=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Index.php | 26 ++++++++++++++++++++++++++ app/view/index/index.html | 21 +++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/app/controller/Index.php b/app/controller/Index.php index 2f7fa0e..36ec575 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -258,6 +258,32 @@ class Index extends BaseController return json($this->json_data); } + /** + * 批量删除 + * @return Json + * @throws \Exception + */ + public function phoneReset() + { + // + $params = array_filter($this->request->param()); + $params_1 = $params; + unset($params_1['car_phone_empty'], $params['data_check'], $params['car_frame_check']); + if (empty($params_1)) { + $this->json_data['code'] = 0; + $this->json_data['msg'] = '搜索条件不能为空'; + return json($this->json_data); + } + $map = $this->getQueryCondition($params); + if($this->model->where($map)->update(['car_phone' => ''])){ + $this->json_data['msg'] = '请求成功'; + }else { + $this->json_data['code'] = 0; + $this->json_data['msg'] = '请求失败'; + } + return json($this->json_data); + } + /** * @param $id * @return Json diff --git a/app/view/index/index.html b/app/view/index/index.html index 656af34..4eb54b9 100644 --- a/app/view/index/index.html +++ b/app/view/index/index.html @@ -36,6 +36,7 @@ 重置条件 +