diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 3ab21719..ec869269 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -238,6 +238,8 @@ class Customer extends HD_Controller !$params['level'] && $params['level'] = ''; !$params['of_id'] && $params['of_id'] = ''; !$params['of2_id'] && $params['of2_id'] = ''; + !$params['city_id'] && $params['city_id'] = ''; + !$params['county_id'] && $params['county_id'] = ''; !$params['biz_type'] && $params['biz_type'] = ''; !$params['tags'] && $params['tags'] = ''; !$params['tagsIntention'] && $params['tagsIntention'] = ''; @@ -269,6 +271,12 @@ class Customer extends HD_Controller if ($params['of2_id']) { $where['of2_id'] = $params['of2_id']; } + if ($params['city_id']) { + $where['city_id'] = $params['city_id']; + } + if ($params['county_id']) { + $where['county_id'] = $params['county_id']; + } if (strlen($params['wxqy'])) { $where["wxqy"] = $params['wxqy']; } else { @@ -373,7 +381,8 @@ class Customer extends HD_Controller $id = $this->input->get('id'); $this->load->model('auto/auto_series_model'); $this->load->model('auto/auto_attr_model'); - $row = $this->customers_model->get(array('id' => $id)); + $select = '*, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name'; + $row = $this->customers_model->get(array('id' => $id), $select); if (!$row) { return $this->show_json(SYS_CODE_FAIL, '客户不存在!'); } @@ -455,6 +464,7 @@ class Customer extends HD_Controller 'tag_intention' => $tag_intention, 'tag_group' => $tag_group, 'biz_type' => $biz_type, + 'city_county' => $row['city_name'] ? $row['city_name'].$row['county_name'] : '-', ); //到店信息 @@ -772,6 +782,8 @@ class Customer extends HD_Controller 'mobile' => '手机', 'level' => '客户等级', 'status_name' => '客户状态', + 'city_name' => '所在城市', + 'county_name' => '所在地区', 'to_send' => '是否改派', 'c_time' => '建档时间', "dt_time" => "到店时间", @@ -792,7 +804,7 @@ class Customer extends HD_Controller $status_arr = $this->customers_model->get_status(); unset($status_arr['-1']); if ($count) { - $fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr"; + $fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name"; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); foreach ($rows as $key => $val) { $of_title = ''; @@ -811,6 +823,8 @@ class Customer extends HD_Controller 'mobile' => $val['mobile'], 'level' => $val['level'], 'status_name' => $status_arr[$val['status']], + 'city_name' => $val['city_name'], + 'county_name' => $val['county_name'], 'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0), 'c_time' => $val['c_time'], 'dt_time' => $val['dt_time'], diff --git a/admin/views/receiver/customer/get.php b/admin/views/receiver/customer/get.php index 155175ed..84ccb2c2 100644 --- a/admin/views/receiver/customer/get.php +++ b/admin/views/receiver/customer/get.php @@ -62,12 +62,19 @@ 微信好友:{{info.wx_name}} 客户等级:{{info.level}} - + + 客户位置:{{info.city_county}} 是否改派:{{info.to_send}} 分销来源:{{info.cf_user}} - - + + + + + + + +
diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index 37d8edfe..cb6e9ffb 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -80,18 +80,31 @@
-
+
-
+
+ +
+ +
+
+ +
@@ -412,6 +425,8 @@ of2Ary: [], bizTypeAry: [], export_button: 0, + cityAry: [], + countyAry: [], }, mounted: function () { var vm = this; @@ -638,6 +653,7 @@ if (response.code == 1) { //vm.cityAry = response.data; vm.admins.cityAry = JSON.parse(JSON.stringify(response.data)); + vm.cityAry = JSON.parse(JSON.stringify(response.data)); } } }); @@ -649,6 +665,7 @@ that.cfrom_id = 0; that.cfrom_id2 = 0; that.params.city_id_admin = ''; + that.params.city_id = ''; that.params.of_id = ''; that.params.of2_id = ''; $('#id_tags').val(''); @@ -715,6 +732,32 @@ }); } }, + 'params.city_id': function (nv, ov) { + var that = this; + if (nv == '') { + that.countyAry = []; + that.county_id_admin = ''; + } else { + if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) { + that.params.county_id = ''; + } + $.ajax({ + type: 'get', + url: '/common/area', + dataType: 'json', + data: { + id: nv, + key: 'county', + type: 1 + }, + success: function (response) { + if (response.code == 1) { + that.countyAry = response.data; + } + } + }); + } + }, 'params.county_id_admin': function (nv, ov) { var that = this; if (nv == '') { diff --git a/api/controllers/wxapp/licheb/CusorderV2.php b/api/controllers/wxapp/licheb/CusorderV2.php index a3acb987..1d280746 100644 --- a/api/controllers/wxapp/licheb/CusorderV2.php +++ b/api/controllers/wxapp/licheb/CusorderV2.php @@ -1110,7 +1110,6 @@ class CusorderV2 extends Wxapp $c_credit = $this->input_param('credit'); $address = $this->input_param('address'); $car_city_id = $this->input_param('c_city_id'); - $pro = $this->input_param('pro'); $row = $this->orders_model->get(['id' => $id]); if (!$row) { @@ -1127,12 +1126,23 @@ class CusorderV2 extends Wxapp $c_credit && $info_json['c_credit'] = $c_credit; $company && $info_json['c_company'] = $company; # 20230222 地址的值用身份证上面的地址 - /*if ($pro) { + /*$pro = $this->input_param('pro'); + if ($pro) { $info_json['pro'] = $pro; $address = implode(' ', $pro) . $address; }*/ $address && $info_json['c_address'] = $address; $car_city_id && $info_json['car_city_id'] = $car_city_id; + + # 23-04-06: 购车人也需要加个修改功能 + #if(!$this->receiver_order_status_model->count(['o_id'=>$id,'pid_status'=>3,'status'=>1])){} + $name = trim($this->input_param('name')); + $mobile = trim($this->input_param('mobile')); + $cardid = trim($this->input_param('cardid')); + $name && $name != $row['name'] && $data['name'] = $name; + $mobile && $mobile != $row['mobile'] && $data['mobile'] = $mobile; + $cardid && $cardid != $info_json['c_cardid'] && $info_json['c_cardid'] = $cardid; + $info_json && $data['info_json'] = json_encode($info_json, JSON_UNESCAPED_UNICODE); $result = $this->orders_model->update($data, ['id' => $row['id']]); if ($result) {