From acc513a33de26730bd8eabacbf6491dd7c5e1529 Mon Sep 17 00:00:00 2001 From: wh <382379437@qq.com> Date: Sat, 22 Mar 2025 22:46:52 +0800 Subject: [PATCH] update --- .../admin/controller/Firmcustomer.php | 2 - .../admin/controller/Firmcustomerorigin.php | 1 - .../application/admin/controller/Firmtags.php | 57 +++++++++++++++++++ .../admin/controller/Gechatroom.php | 16 +++--- .../admin/controller/Gewechatfriends.php | 2 +- .../admin/view/firmbigcategory/add.html | 4 +- .../admin/view/firmbigcategory/edit.html | 4 +- .../admin/view/firmcustomer/add.html | 29 +++++++--- .../admin/view/firmcustomer/edit.html | 38 +++++++------ .../admin/view/firmcustomer/index.html | 3 +- .../view/firmcustomerfollowuprecord/add.html | 10 +++- .../view/firmcustomerfollowuprecord/edit.html | 9 ++- .../admin/view/firmcustomerorigin/add.html | 5 +- .../admin/view/firmcustomerorigin/edit.html | 5 +- .../application/admin/view/firmduty/add.html | 10 +++- .../application/admin/view/firmduty/edit.html | 10 +++- .../admin/view/firmemployee/add.html | 10 +++- .../admin/view/firmemployee/edit.html | 5 +- .../admin/view/firmfollowuptemplate/add.html | 10 +++- .../admin/view/firmfollowuptemplate/edit.html | 4 +- .../admin/view/firmnotespoints/add.html | 5 +- .../admin/view/firmnotespoints/edit.html | 4 +- .../application/admin/view/firmstore/add.html | 5 +- .../admin/view/firmstore/edit.html | 5 +- .../admin/view/firmstoreprojectsone/add.html | 10 +++- .../admin/view/firmstoreprojectsone/edit.html | 9 ++- .../admin/view/firmstoreprojectstwo/add.html | 10 +++- .../admin/view/firmstoreprojectstwo/edit.html | 9 ++- .../application/admin/view/firmtags/add.html | 6 +- .../application/admin/view/firmtags/edit.html | 4 +- .../application/api/logic/GechatroomLogic.php | 9 ++- .../public/assets/js/backend/firmcustomer.js | 14 +++++ 32 files changed, 248 insertions(+), 76 deletions(-) diff --git a/admin/application/admin/controller/Firmcustomer.php b/admin/application/admin/controller/Firmcustomer.php index d6d0175..fddedc3 100644 --- a/admin/application/admin/controller/Firmcustomer.php +++ b/admin/application/admin/controller/Firmcustomer.php @@ -93,8 +93,6 @@ class Firmcustomer extends Backend if (false === $this->request->isPost()) { return $this->view->fetch(); } - dump(input()); - die; $params = $this->request->post('row/a'); if (empty($params)) { $this->error(__('Parameter %s can not be empty', '')); diff --git a/admin/application/admin/controller/Firmcustomerorigin.php b/admin/application/admin/controller/Firmcustomerorigin.php index fcd78de..cf7b6fa 100644 --- a/admin/application/admin/controller/Firmcustomerorigin.php +++ b/admin/application/admin/controller/Firmcustomerorigin.php @@ -24,7 +24,6 @@ class Firmcustomerorigin extends Backend $this->model = new \app\admin\model\Firmcustomerorigin; $this->model->where('firm_id',session_admin_firm_id()); - $this->model->where('firmstore_id',session_admin_firmstore_id()); } diff --git a/admin/application/admin/controller/Firmtags.php b/admin/application/admin/controller/Firmtags.php index bfbe9d2..ebf9a2d 100644 --- a/admin/application/admin/controller/Firmtags.php +++ b/admin/application/admin/controller/Firmtags.php @@ -3,6 +3,10 @@ namespace app\admin\controller; use app\common\controller\Backend; +use think\Db; +use think\Exception; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 标签 @@ -69,4 +73,57 @@ class Firmtags extends Backend return $this->view->fetch(); } + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + //$firm_customer_req = input('firm_customer_req'); + //if ($firm_customer_req == 'firm_customer_req'){ + // $html = view('add')->getContent(); + // //将转义的代码还原 + // return json(['html'=>($html)]); + //} + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + function testadd(){ + + $html = view('add')->getContent(); + //将转义的代码还原 + return json(['html'=>($html)]); + } } diff --git a/admin/application/admin/controller/Gechatroom.php b/admin/application/admin/controller/Gechatroom.php index 70704e9..95226d0 100644 --- a/admin/application/admin/controller/Gechatroom.php +++ b/admin/application/admin/controller/Gechatroom.php @@ -28,15 +28,15 @@ class Gechatroom extends Controller */ function getChatroomList() { - //if(cache('cache_getChatroomList_data'.session_admin_firm_id())){ - // $data = cache('cache_getChatroomList_data'.session_admin_firm_id()); - // //自带id,name - // return json(['list' => $data, 'total' => count($data)]); - //} + if(cache('cache_getChatroomList_data'.session_admin_firm_id())){ + $data = cache('cache_getChatroomList_data'.session_admin_firm_id()); + //自带id,name + return json(['list' => $data, 'total' => count($data)]); + } $data = (new GechatroomLogic())->getChatroomList(); - dump($data);die; + //dump($data);die; //缓存群成员列表 - cache('cache_getChatroomList_data'.session_admin_firm_id(),$data,3600); + cache('cache_getChatroomList_data'.session_admin_firm_id(),$data,86400); //自带id,name return json(['list' => $data, 'total' => count($data)]); } @@ -58,7 +58,7 @@ class Gechatroom extends Controller } $data = (new GechatroomLogic())->getChatroomList(); //缓存群成员列表 - cache('cache_getChatroomList_data'.session_admin_firm_id(),$data['memberList'],3600); + cache('cache_getChatroomList_data'.session_admin_firm_id(),$data['memberList'],86400); $memberList = $data[$chatroom_id]['memberList']; return json(['list' => $memberList, 'total' => count($memberList)]); } diff --git a/admin/application/admin/controller/Gewechatfriends.php b/admin/application/admin/controller/Gewechatfriends.php index e1dc509..ddd36ad 100644 --- a/admin/application/admin/controller/Gewechatfriends.php +++ b/admin/application/admin/controller/Gewechatfriends.php @@ -35,7 +35,7 @@ class Gewechatfriends extends Controller $v['id'] = $v['userName'] ?? '无'; $v['name'] = $v['nickName'] ?? '无'; } - cache('cache_getFriendDetailList_data'.session_admin_firm_id(),$data,96400); + cache('cache_getFriendDetailList_data'.session_admin_firm_id(),$data,86400); return json(['list' => $data, 'total' => count($data)]); } diff --git a/admin/application/admin/view/firmbigcategory/add.html b/admin/application/admin/view/firmbigcategory/add.html index 96c6c0a..a8c7730 100644 --- a/admin/application/admin/view/firmbigcategory/add.html +++ b/admin/application/admin/view/firmbigcategory/add.html @@ -9,7 +9,9 @@