From 20c3bf1f5283b924ab12ed03a8d5e15d3bf1ff7f Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Thu, 24 Mar 2022 15:40:17 +0800 Subject: [PATCH] edit-api-post_clues --- api/controllers/wxapp/app/Tag.php | 39 +++++++++++++++++++++++++++ api/controllers/wxapp/liche/Clues.php | 20 +++++++++++--- 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 api/controllers/wxapp/app/Tag.php diff --git a/api/controllers/wxapp/app/Tag.php b/api/controllers/wxapp/app/Tag.php new file mode 100644 index 00000000..d4747ac7 --- /dev/null +++ b/api/controllers/wxapp/app/Tag.php @@ -0,0 +1,39 @@ +login_white = array();//登录白名单 + $this->check_status = array();//用户状态校验 + $this->check_mobile = array();//需要手机号 + $this->check_headimg =array();//授权微信信息 + $this->load->model('receiver/receiver_customer_tag_model'); + $this->load->model('receiver/receiver_customer_tagdata_model'); + } + //获取标签 + protected function get(){ + $page = $this->input_param('page'); + $size = $this->input_param('size'); + $pid = $this->input_param('pid'); + !strlen($pid) && $pid = 0; + !$page && $page = 1; + !$size && $size = 20; + + $where = [ + 'pid' => $pid, + 'status' => 1 + ]; + $count = $this->receiver_customer_tag_model->count($where); + $list = $this->receiver_customer_tag_model->select($where,'sort desc,id desc',$page,$size,'id,name'); + $data = [ + 'list' => $list, + 'total' => $count + ]; + return $data; + } + +} diff --git a/api/controllers/wxapp/liche/Clues.php b/api/controllers/wxapp/liche/Clues.php index 431351c4..08fa2f2b 100644 --- a/api/controllers/wxapp/liche/Clues.php +++ b/api/controllers/wxapp/liche/Clues.php @@ -24,6 +24,7 @@ class Clues extends Wxapp $this->load->model('receiver/receiver_clue_oplogs_model'); $this->load->model('receiver/order/receiver_orders_model'); $this->load->model('auto/auto_brand_model'); + $this->load->model('receiver/receiver_customer_tagdata_model'); } protected function get() @@ -41,11 +42,11 @@ class Clues extends Wxapp $cf_id = 8; $name = $this->input_param('name'); $mobile = $this->input_param('mobile'); - $brand_id = $this->input_param('brand_id'); $remark = $this->input_param('remark'); $intro_biz_id = intval($this->input_param('intro_biz_id')); $intro_uid = intval($this->input_param('intro_uid')); - if (!$mobile || !$name || !$brand_id) { + $tag_ids = $this->input_param('tag_ids'); + if (!$mobile || !$name) { throw new Exception('参数错误', ERR_PARAMS_ERROR); } if (!mobile_valid($mobile)) { @@ -59,7 +60,6 @@ class Clues extends Wxapp 'app_id' => $this->app_id, 'name' => $name, 'mobile' => $mobile, - 'brand_id' => $brand_id, 'recommend_id' => $this->session['uid'], 'cf_uid' => $this->session['uid'], 'cf_platform' => 'wxapp', @@ -99,7 +99,7 @@ class Clues extends Wxapp 'biz_id' => $re_biz['id'], 'city_id' => $re_biz['city_id'], 'county_id' => $re_biz['county_id'], - 'brand_id' => $clues_row['brand_id'], + 'brand_id' => 0, 's_id' => 0, 'if_driver' => 0, 'cf_title' => '自有资源', @@ -111,6 +111,18 @@ class Clues extends Wxapp ]; $customers_id = $this->mdCustomers->add($add_data); if ($customers_id) { + if($tag_ids){ + $add_tag = []; + //查找已加入标签 + foreach($tag_ids as $val){ + $add_tag[] = [ + 'c_id' => $customers_id, + 't_id' => $val, + 'c_time' => time() + ]; + } + $this->receiver_customer_tagdata_model->add_batch($add_tag); + } $content = "指定给【{$re_biz['biz_name']}】商家"; if ($intro_uid) { $this->load->model('app/licheb/app_licheb_users_model', 'mdUsers');