From 898a8b73243be8ccaf6e400a4ab9d32a109003d9 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 7 Apr 2022 14:06:17 +0800 Subject: [PATCH] tag_407 --- api/controllers/wechat/Lichene.php | 38 +++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/api/controllers/wechat/Lichene.php b/api/controllers/wechat/Lichene.php index fa3c10d1..1b62dc37 100644 --- a/api/controllers/wechat/Lichene.php +++ b/api/controllers/wechat/Lichene.php @@ -261,16 +261,29 @@ Class Lichene extends HD_Controller * Notes:显示客户标签 * Created on: 2022/3/24 15:01 * Created by: dengbw - * https://liche-api-dev.xiaoyu.com/wechat/lichene/show_corp_tag + * https://liche-api-dev.xiaoyu.com/wechat/lichene/show_corp_tag?sd=1 * https://api.liche.cn/wechat/lichene/show_corp_tag */ public function show_corp_tag() { $this->load->model('receiver/receiver_customer_tag_model', 'mdCustomerTag'); + $param = $this->input->get(); + if ($param['sd']) { + $where = ['pid' => 0]; + $select = 'id,name,qy_id,sort,status'; + } else { + $where = ["status" => 1, 'pid' => 0]; + $select = 'id,name,qy_id,sort'; + } $list = []; - $res = $this->mdCustomerTag->select(["status" => 1, 'pid' => 0], "sort desc,id desc", 0, 0, 'id,name,qy_id,sort'); + $res = $this->mdCustomerTag->select($where, "sort desc,id desc", 0, 0, $select); foreach ($res as $key => $value) { - $res_tag = $this->mdCustomerTag->select(["status" => 1, 'pid' => $value['id']], "sort desc,id desc", 0, 0, 'id,name,qy_id,sort'); + if ($param['sd']) { + $where2 = ["status" => 1, 'pid' => $value['id']]; + } else { + $where2 = ['pid' => $value['id']]; + } + $res_tag = $this->mdCustomerTag->select($where2, "sort desc,id desc", 0, 0, $select); $value['options'] = $res_tag; $list[] = $value; } @@ -327,6 +340,25 @@ Class Lichene extends HD_Controller echo json_encode($re_yq, JSON_UNESCAPED_UNICODE); } + /** + * Notes:删除客户标签 + * Created on: 2022/4/06 15:01 + * Created by: dengbw + * https://liche-api-dev.xiaoyu.com/wechat/lichene/del_tag?ids=1,2,3 + * https://api.liche.cn/wechat/lichene/del_tag + */ + public function del_tag() + { + $param = $this->input->get(); + if (!$param['ids']) { + echo '无ids'; + exit; + } + $this->load->model('receiver/receiver_customer_tag_model', 'mdCustomerTag'); + $ret = $this->mdCustomerTag->delete(['status' => -1, "id in({$param['ids']})" => null]); + print_r($ret); + } + /** * Notes:批量添加企业客户标签 * Created on: 2022/3/24 15:01