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 @@ +
| 所在城市: | +
+
+
+
+
+
+
+ |
+
| 企微好友: | +
+
+
+ |
+