From bf42ad618abd161a1fd7257ea58d5251a5d9af33 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 21 Apr 2022 15:28:24 +0800 Subject: [PATCH] customer_421 --- admin/controllers/receiver/Customer.php | 2 +- admin/controllers/receiver/Tag.php | 21 ++++++++++++------- admin/views/receiver/tag/edit.php | 11 ++++++++++ admin/views/receiver/tag/lists.php | 20 +++++++++++++++--- api/controllers/wxapp/licheb/Customers.php | 2 +- .../receiver/Receiver_customer_tag_model.php | 15 +++++++++++-- 6 files changed, 57 insertions(+), 14 deletions(-) diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 388d5ab1..64c0666a 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -568,7 +568,7 @@ class Customer extends HD_Controller private function get_tag($id) { $show = $res_td = []; - $res = $this->mdCustomerTag->select(['status' => 1, 'pid' => 0], 'sort desc,id desc', 0, 0, 'id,name,type'); + $res = $this->mdCustomerTag->select(['status' => 1, 'pid' => 0, 'show<>' => 1], 'sort desc,id desc', 0, 0, 'id,name,type'); if ($res) { $id && $res_td = $this->mdCustomerTagdata->select(['c_id' => $id], 'id desc', 0, 0, 't_id');//查找用户选择 $tag_data = $res_td ? array_unique(array_column($res_td, 't_id')) : ''; diff --git a/admin/controllers/receiver/Tag.php b/admin/controllers/receiver/Tag.php index ac652f02..6d39007b 100644 --- a/admin/controllers/receiver/Tag.php +++ b/admin/controllers/receiver/Tag.php @@ -25,11 +25,15 @@ class Tag extends HD_Controller $params['size'] = $params['size'] ? intval($params['size']) : 20; $statusAry = $this->mdCustomerTag->statusAry(); $typeAry = $this->mdCustomerTag->typeAry(); + $showAry = $this->mdCustomerTag->showAry(); $lists = array(); $where = ["status<>-1" => null, 'pid' => 0]; if (strlen($params['status'])) { $where['status'] = $params['status']; } + if (strlen($params['show'])) { + $where['show'] = $params['show']; + } if ($params['type']) { $where['type'] = $params['type']; } @@ -44,6 +48,7 @@ class Tag extends HD_Controller $setValue['type_name'] = $typeAry[$value['type']]; $setValue['status'] = $value['status']; $setValue['status_name'] = $statusAry[$value['status']]; + $setValue['show_name'] = $showAry[$value['show']]; $options = ''; $res_tag = $this->mdCustomerTag->select(["status" => 1, 'pid' => $value['id']], "sort desc,id desc", 0, 0, 'id,name,sort'); $res_tag && $options = implode(',', array_column($res_tag, 'name')); @@ -53,7 +58,7 @@ class Tag extends HD_Controller } $this->data['lists'] = $lists; $this->data['params'] = $params; - $this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry]; + $this->data['showInfo'] = ['statusAry' => $statusAry, 'typeAry' => $typeAry, 'showAry' => $showAry]; $this->data['_title'] = '客户标签列表'; $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); return $this->show_view('/receiver/tag/lists', true); @@ -83,14 +88,15 @@ class Tag extends HD_Controller $name = $re['name']; $sort = $re['sort']; $type = $re['type']; + $show = $re['show']; } else { $url = "/receiver/tag/add"; $name = ''; - $sort = 0; + $sort = $show = 0; $type = 'checkbox'; } - $this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'type' => $type, - 'typeAry' => $this->mdCustomerTag->typeAry(), 'url' => $url]; + $this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'type' => $type, 'show' => $show, + 'typeAry' => $this->mdCustomerTag->typeAry(), 'showAry' => $this->mdCustomerTag->showAry(), 'url' => $url]; return $this->show_view('/receiver/tag/edit'); } @@ -105,7 +111,8 @@ class Tag extends HD_Controller if ($re) { return $this->show_json(SYS_CODE_FAIL, '标签名称已存在了!'); } - $id = $this->mdCustomerTag->add(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']]); + $id = $this->mdCustomerTag->add(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type'] + , 'show' => $params['show']]); if (!$id) { return $this->show_json(SYS_CODE_FAIL, '保存失败'); } @@ -132,8 +139,8 @@ class Tag extends HD_Controller $this->wx_qyapi->get_external_contact(['url' => 'edit_corp_tag', 'id' => $re['qy_id'] , 'name' => $params['name'], 'order' => $params['sort']]); } - $this->mdCustomerTag->update(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type']] - , ['id' => $params['id']]); + $this->mdCustomerTag->update(['name' => $params['name'], 'sort' => $params['sort'], 'type' => $params['type'] + , 'show' => $params['show']], ['id' => $params['id']]); return $this->show_json(SYS_CODE_SUCCESS, '保存成功'); } diff --git a/admin/views/receiver/tag/edit.php b/admin/views/receiver/tag/edit.php index c73770c5..9acfd542 100644 --- a/admin/views/receiver/tag/edit.php +++ b/admin/views/receiver/tag/edit.php @@ -18,6 +18,17 @@ +
+ +
+ +
+
diff --git a/admin/views/receiver/tag/lists.php b/admin/views/receiver/tag/lists.php index 93186187..9fb064fa 100644 --- a/admin/views/receiver/tag/lists.php +++ b/admin/views/receiver/tag/lists.php @@ -3,7 +3,7 @@ action="receiver/tag">
- +
+ + $value) { ?> + + + +
+
+
+