From 6ec9081b1b603529bb61ac96c8e1ee0d607cef0d Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 8 Jul 2022 11:08:34 +0800 Subject: [PATCH] Customers_708 --- admin/controllers/Common.php | 13 +++++++++ admin/controllers/receiver/Customer.php | 10 +++++-- admin/views/receiver/customer/lists.php | 37 +++++++++++++++++++++---- 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 3e3ffd0e..183d3524 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -16,6 +16,19 @@ class Common extends CI_Controller public $data = array(); + //获取门店类型数组 + public function biz_type_ary() + { + $this->load->model('biz/biz_model', 'mdBiz'); + $list = []; + $type_ary = $this->mdBiz->type_ary(); + foreach ($type_ary as $key => $value) { + $list[] = ['id' => $key, 'name' => $value]; + } + $this->data = $list; + return $this->show_json(SYS_CODE_SUCCESS); + } + /** * Notes:获取车系 * Created on: 2022/3/18 17:09 diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index f791bbb3..90e1ba75 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -48,13 +48,19 @@ class Customer extends HD_Controller !$params['level'] && $params['level'] = ''; !$params['of_id'] && $params['of_id'] = ''; !$params['of2_id'] && $params['of2_id'] = ''; + !$params['biz_type'] && $params['biz_type'] = ''; $page = $params['page'] = $params['page'] ? intval($params['page']) : 1; $size = $params['size'] = $params['size'] ? intval($params['size']) : 20; - $where = array('status>=0' => null); if ($_SESSION['admin_info']['biz_id']) { $biz_ids = implode(',', $_SESSION['admin_info']['biz_id']); - $where["biz_id in ($biz_ids)"] = null; + if ($params['biz_type']) { + $where["biz_id in(select id from lc_biz where type={$params['biz_type']} and status=1 and id in({$biz_ids}))"] = null; + } else { + $where["biz_id in ($biz_ids)"] = null; + } + } else if ($params['biz_type']) { + $where["biz_id in(select id from lc_biz where type={$params['biz_type']} and status=1)"] = null; } if (false == strpos($_SERVER['HTTP_HOST'], 'dev')) {//dev时不限制 $where['biz_id<>'] = 1; diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index 0d11188b..18a4856d 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -22,7 +22,7 @@
- +
@@ -44,7 +44,7 @@
- +
@@ -63,7 +63,7 @@
- +
+ + + +
+
+
+