diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 12d9154d..afedaf24 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -48,7 +48,6 @@ class Customer extends HD_Controller !$params['level'] && $params['level'] = ''; !$params['of_id'] && $params['of_id'] = ''; !$params['of2_id'] && $params['of2_id'] = ''; - !$params['wxqy'] && $params['wxqy'] = ''; $page = $params['page'] = $params['page'] ? intval($params['page']) : 1; $size = $params['size'] = $params['size'] ? intval($params['size']) : 20; @@ -73,9 +72,13 @@ class Customer extends HD_Controller if ($params['of2_id']) { $where['of2_id'] = $params['of2_id']; } + if (strlen($params['wxqy'])) { + $where["wxqy"] = $params['wxqy']; + } else { + $params['wxqy'] = ''; + } !$params['search_tp'] && $params['search_tp'] = 'mobile'; strlen($params['status']) && $where["status"] = $params['status']; - strlen($params['wxqy']) && $where["wxqy"] = $params['wxqy']; if ($params['qdjl_id']) { $where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } diff --git a/admin/controllers/receiver/Owners.php b/admin/controllers/receiver/Owners.php index 3bd708d2..118b7d41 100644 --- a/admin/controllers/receiver/Owners.php +++ b/admin/controllers/receiver/Owners.php @@ -58,6 +58,21 @@ class Owners extends HD_Controller $u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00'; $u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59'; } + if (strlen($params['wxqy'])) { + $where["wxqy"] = $params['wxqy']; + } else { + $params['wxqy'] = ''; + } + if ($params['city_id']) { + $where["city_id"] = $params['city_id']; + } else { + $params['city_id'] = ''; + } + if ($params['county_id']) { + $where["county_id"] = $params['county_id']; + } else { + $params['county_id'] = ''; + } if ($params['sex']) { $where["sex"] = $params['sex']; } else { @@ -80,10 +95,12 @@ class Owners extends HD_Controller } $count = $this->mdOwners->count($where); $lists = []; + $wxqyAry = $this->mdOwners->wxqyAry(); if ($count) { $this->load->model('auto/auto_brand_model', 'mdBrand'); $this->load->model('auto/auto_series_model', 'mdSeries'); $this->load->model('auto/auto_attr_model', 'mdAttr'); + $this->load->model('area_model', 'mdArea'); $res = $this->mdOwners->select($where, 'id desc', $page, $size); $str_brand_ids = implode(',', array_unique(array_column($res, 'brand_id'))); @@ -92,20 +109,26 @@ class Owners extends HD_Controller $map_series = $this->mdSeries->map('id', 'name', ["id in({$str_s_ids})" => null]); $str_v_ids = implode(',', array_unique(array_column($res, 'v_id'))); $map_attrs = $this->mdAttr->map('id', 'title', ["id in({$str_v_ids})" => null]); - + $str_county_ids = implode(',', array_unique(array_column($res, 'county_id'))); + $map_countys = $this->mdArea->map('county_id', 'city_name,county_name', ["county_id in({$str_county_ids})" => null]); foreach ($res as $key => $val) { if (SUPER_ADMIN == $this->role || $this->role == 35) { $mobile_sub = $val['mobile']; } else { $mobile_sub = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : ''; } - $sex = $car_name = ''; + $sex = $car_name = $city_name = ''; if ($val['sex']) { $sex = $val['sex'] == 1 ? '男' : '女'; } $map_brands[$val['brand_id']] && $car_name = $map_brands[$val['brand_id']]; $map_series[$val['s_id']] && $car_name = $car_name ? $car_name . '-' . $map_series[$val['s_id']] : $map_series[$val['s_id']]; $map_attrs[$val['v_id']] && $car_name = $car_name ? $car_name . '-' . $map_attrs[$val['v_id']] : $map_attrs[$val['v_id']]; + $map_countys[$val['county_id']] && $city_name = $map_countys[$val['county_id']]['city_name'] . '-' . $map_countys[$val['county_id']]['county_name']; + if (!$city_name && $val['city_id']) { + $re_are = $this->mdArea->get(['city_id' => $val['city_id']]); + $re_are && $city_name = $re_are['city_name']; + } $lists[] = array( 'id' => $val['id'], 'name' => $val['name'], @@ -114,6 +137,8 @@ class Owners extends HD_Controller 'sex' => $sex, 'age' => $this->getAgeByBirth($val['birth_day']), 'car_name' => $car_name, + 'city_name' => $city_name, + 'wxqy' => $wxqyAry[$val['wxqy']], 'car_num' => $val['car_num'], 'order_time' => $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : '', 'ck_time' => $val['ck_time'] != '0000-00-00 00:00:00' ? $val['ck_time'] : '', @@ -121,9 +146,11 @@ class Owners extends HD_Controller ); } } + $show_info['searchTpAry'] = $this->searchTpAry; + $show_info['wxqyAry'] = $wxqyAry; + $this->data['show_info'] = $show_info; $this->data['lists'] = $lists; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); - $this->data['searchTpAry'] = $this->searchTpAry; $this->data['searchTimeAry'] = $this->searchTimeAry; $this->data['params'] = $params; $this->data['_title'] = '车主列表'; @@ -183,6 +210,8 @@ class Owners extends HD_Controller ); } } + $show_info['wxqyAry'] = $this->mdOwners->wxqyAry(); + $this->data['show_info'] = $show_info; $this->data['info'] = $info; $this->data['logs'] = $logs; $this->data['_title'] = '车主户详情'; @@ -244,7 +273,8 @@ class Owners extends HD_Controller //更新车主信息 $ret = $this->mdOwners->update(['name' => $info['name'], 'birth_day' => $info['birth_day'], 'sex' => $info['sex'], 'brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'v_id' => $info['v_id'], 'car_num' => $info['car_num'], - 'order_time' => $info['order_time'], 'ck_time' => $info['ck_time']], ['id' => $info['id']]); + 'order_time' => $info['order_time'], 'ck_time' => $info['ck_time'], 'wxqy' => $info['wxqy'] + , 'city_id' => $info['city_id'], 'county_id' => $info['county_id']], ['id' => $info['id']]); if (!$ret) { $code = SYS_CODE_FAIL; $msg = '修改车主信息失败'; diff --git a/admin/views/receiver/owners/get.php b/admin/views/receiver/owners/get.php index d564dd41..2910c60d 100644 --- a/admin/views/receiver/owners/get.php +++ b/admin/views/receiver/owners/get.php @@ -108,6 +108,44 @@ + + + + + + + +
所在城市: +
+ +
+
+ +
+
+ + + + + + + +
企微好友: +
+
+
+ + + +
@@ -279,17 +317,22 @@ data: { edit_index: 0, info: {}, + show_info: {}, logs: [], brandAry: [], seryAry: [], attrvAry: [], - goods: {"imgs_url": [], "imgs": [], "log": ''} + goods: {"imgs_url": [], "imgs": [], "log": ''}, + cityAry: [], + countyAry: [] }, mounted: function () { var that = this; that.info = ; + that.show_info = ; that.logs = ; that.init_brands(); + that.init_citys(); }, computed: {}, created: function () { @@ -297,6 +340,21 @@ updated: function () { }, methods: { + init_citys: function () { + var vm = this; + $.get('common/area', {id: '350', key: 'city', type: 1}, function (response) { + if (response.code == 1) { + vm.cityAry = response.data; + } + }); + if (vm.info.city_id > 0) { + $.get('common/area', {id: vm.info.city_id, key: 'county', type: 1}, function (response) { + if (response.code == 1) { + vm.countyAry = response.data; + } + }); + } + }, init_brands: function () { var vm = this; $.ajax({ @@ -400,6 +458,30 @@ }, }, watch: { + 'info.city_id': function (nv, ov) { + var that = this; + if (nv == '') { + that.countyAry = []; + that.info.county_id = '0'; + } else { + $.get('common/area', {id: nv, key: 'county', type: 1}, function (response) { + if (response.code == 1) { + that.countyAry = response.data; + if (that.info.county_id > 0) { + var county_id = '0'; + for (var i in that.countyAry) { + var county = that.countyAry[i]; + if (county.id == that.info.county_id) { + county_id = county.id; + break; + } + } + that.info.county_id = county_id; + } + } + }); + } + }, 'info.brand_id': function (nv, ov) { var vm = this; vm.seryAry = {}; @@ -466,7 +548,7 @@ elem: '#birth_day' , type: 'date' , done: function (value, date) { - vue_obj.info.birth_day = value; + vue_obj.info.birth_day = value; } }); laydate.render({ diff --git a/admin/views/receiver/owners/lists.php b/admin/views/receiver/owners/lists.php index 790dc72d..68be57da 100644 --- a/admin/views/receiver/owners/lists.php +++ b/admin/views/receiver/owners/lists.php @@ -7,7 +7,7 @@
@@ -26,6 +26,31 @@ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
@@ -89,12 +114,12 @@ ID - 车主姓名 - 车主电话 + 车主 车辆 车牌号 性别 年龄 + 企微好友 购车时间 交付时间 最后操作时间 @@ -104,12 +129,12 @@