diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 90e1ba75..49450b69 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -91,54 +91,66 @@ class Customer extends HD_Controller //销售员筛选 if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; + } else if ($params['biz_id_admin']) { + $where['biz_id'] = $params['biz_id_admin']; } else { - $where_lcb = array(); - $str_ids = ''; - if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; - $str_ids = $params['biz_id_admin']; - } else { - //指定城市的所有销售员 - $where_biz = array(); - if ($params['county_id_admin']) { - $where_biz['county_id'] = $params['county_id_admin']; - } else if ($params['city_id_admin']) { - $where_biz['city_id'] = $params['city_id_admin']; - } - if ($where_biz) { - $where_biz['status>-1'] = null; - $rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id'); - if ($rows_biz) { - $str_ids = implode(',', array_column($rows_biz, 'id')); - $where_lcb["biz_id in({$str_ids})"] = null; - } else { - $where_lcb['biz_id'] = -1; - } - } - } - //获取目标销售员列表 - if ($where_lcb) { - $params['city_id_admin'] && $where['city_id'] = $params['city_id_admin']; - $params['county_id_admin'] && $where['county_id'] = $params['county_id_admin']; - $params['biz_id_admin'] && $where['biz_id'] = $params['biz_id_admin']; - - $where_lcb['status>-1'] = null; - $rows_lcb = $this->app_licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id'); - if ($rows_lcb) { - $str_ids = implode(',', array_column($rows_lcb, 'id')); - $str_ids = $str_ids . ',0'; - $where["admin_id in({$str_ids})"] = null; - } else { - if (!$str_ids) { - $where['admin_id'] = -1; - } - } - } - !$params['city_id_admin'] && $params['city_id_admin'] = ''; - !$params['county_id_admin'] && $params['county_id_admin'] = ''; - !$params['biz_id_admin'] && $params['biz_id_admin'] = ''; - $params['admin_id'] = ''; + $params['city_id_admin'] && $where['city_id'] = $params['city_id_admin']; + $params['county_id_admin'] && $where['county_id'] = $params['county_id_admin']; } + !$params['city_id_admin'] && $params['city_id_admin'] = ''; + !$params['county_id_admin'] && $params['county_id_admin'] = ''; + !$params['biz_id_admin'] && $params['biz_id_admin'] = ''; + !$params['admin_id'] && $params['admin_id'] = ''; +// if ($params['admin_id']) { +// $where['admin_id'] = $params['admin_id']; +// } else { +// $where_lcb = array(); +// $str_ids = ''; +// if ($params['biz_id_admin']) {//指定店铺所有销售员 +// $where_lcb['biz_id'] = $params['biz_id_admin']; +// $str_ids = $params['biz_id_admin']; +// } else { +// //指定城市的所有销售员 +// $where_biz = array(); +// if ($params['county_id_admin']) { +// $where_biz['county_id'] = $params['county_id_admin']; +// } else if ($params['city_id_admin']) { +// $where_biz['city_id'] = $params['city_id_admin']; +// } +// if ($where_biz) { +// $where_biz['status>-1'] = null; +// $rows_biz = $this->biz_model->select($where_biz, 'id desc', 0, 0, 'id'); +// if ($rows_biz) { +// $str_ids = implode(',', array_column($rows_biz, 'id')); +// $where_lcb["biz_id in({$str_ids})"] = null; +// } else { +// $where_lcb['biz_id'] = -1; +// } +// } +// } +// //获取目标销售员列表 +// if ($where_lcb) { +// $params['city_id_admin'] && $where['city_id'] = $params['city_id_admin']; +// $params['county_id_admin'] && $where['county_id'] = $params['county_id_admin']; +// $params['biz_id_admin'] && $where['biz_id'] = $params['biz_id_admin']; +// +// $where_lcb['status>-1'] = null; +// $rows_lcb = $this->app_licheb_users_model->select($where_lcb, 'id desc', 0, 0, 'id'); +// if ($rows_lcb) { +// $str_ids = implode(',', array_column($rows_lcb, 'id')); +// $str_ids = $str_ids . ',0'; +// $where["admin_id in({$str_ids})"] = null; +// } else { +// if (!$str_ids) { +// $where['admin_id'] = -1; +// } +// } +// } +// !$params['city_id_admin'] && $params['city_id_admin'] = ''; +// !$params['county_id_admin'] && $params['county_id_admin'] = ''; +// !$params['biz_id_admin'] && $params['biz_id_admin'] = ''; +// $params['admin_id'] = ''; +// } if ($params['c_time']) { $c_time = explode(' ~ ', $params['c_time']); $c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00'); diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index 18a4856d..900ceeb6 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -88,19 +88,19 @@