diff --git a/admin/controllers/receiver/order/Agent.php b/admin/controllers/receiver/order/Agent.php index 3f164182..decbd3cc 100644 --- a/admin/controllers/receiver/order/Agent.php +++ b/admin/controllers/receiver/order/Agent.php @@ -72,9 +72,45 @@ class Agent extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/controllers/receiver/order/Bill.php b/admin/controllers/receiver/order/Bill.php index 9a9f2980..77992bde 100644 --- a/admin/controllers/receiver/order/Bill.php +++ b/admin/controllers/receiver/order/Bill.php @@ -72,9 +72,45 @@ class Bill extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/controllers/receiver/order/Ckcar.php b/admin/controllers/receiver/order/Ckcar.php index 7c200c7f..8fff75ef 100644 --- a/admin/controllers/receiver/order/Ckcar.php +++ b/admin/controllers/receiver/order/Ckcar.php @@ -72,9 +72,45 @@ class Ckcar extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/controllers/receiver/order/Delivery.php b/admin/controllers/receiver/order/Delivery.php index a2fb8780..e39ee92e 100644 --- a/admin/controllers/receiver/order/Delivery.php +++ b/admin/controllers/receiver/order/Delivery.php @@ -72,9 +72,45 @@ class Delivery extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/controllers/receiver/order/Loan.php b/admin/controllers/receiver/order/Loan.php index 11fd5032..58a5e6ac 100644 --- a/admin/controllers/receiver/order/Loan.php +++ b/admin/controllers/receiver/order/Loan.php @@ -69,9 +69,45 @@ class Loan extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/controllers/receiver/order/Sign.php b/admin/controllers/receiver/order/Sign.php index b3f0cf98..de6c38c4 100644 --- a/admin/controllers/receiver/order/Sign.php +++ b/admin/controllers/receiver/order/Sign.php @@ -79,9 +79,45 @@ class Sign extends HD_Controller{ if($params['admin_id']){ $where['admin_id'] = $params['admin_id']; } else { - $params['city_id_admin'] = ''; - $params['county_id_admin'] = ''; - $params['biz_id_admin'] = ''; + $where_lcb = array(); + if($params['biz_id_admin']){//指定店铺所有销售员 + $where_lcb['biz_id'] = $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; + $this->load->model("biz/biz_model"); + $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){ + $where_lcb['status>-1'] = null; + $this->load->model('app/licheb/App_licheb_users_model', 'licheb_user_model'); + $rows_lcb = $this->licheb_user_model->select($where_lcb, 'id desc', 0, 0, 'id'); + if($rows_lcb){ + $str_ids = implode(',', array_column($rows_lcb, 'id')); + $where["admin_id in({$str_ids})"] = null; + } else { + $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'] = ''; } diff --git a/admin/views/receiver/order/agent/lists.php b/admin/views/receiver/order/agent/lists.php index dcc9bf2f..72ae47b6 100644 --- a/admin/views/receiver/order/agent/lists.php +++ b/admin/views/receiver/order/agent/lists.php @@ -53,7 +53,7 @@
-
+
@@ -117,7 +117,7 @@
- +
@@ -257,6 +257,7 @@ $("#title").val(''); $("#id-create-time").val(''); that.params.brand_id = ''; + that.params.city_id_admin = ''; } }, watch: { diff --git a/admin/views/receiver/order/ckcar/lists.php b/admin/views/receiver/order/ckcar/lists.php index 3c8f956e..d1eab941 100644 --- a/admin/views/receiver/order/ckcar/lists.php +++ b/admin/views/receiver/order/ckcar/lists.php @@ -53,7 +53,7 @@
-
+
@@ -116,6 +116,9 @@
+
+ +
@@ -248,6 +251,14 @@ } }); }, + reset:function(){ + var that = this; + $("#search_tp").val('mobile'); + $("#title").val(''); + $("#id-create-time").val(''); + that.params.brand_id = ''; + that.params.city_id_admin = ''; + } }, watch: { 'params.brand_id':function(nv, ov){ diff --git a/admin/views/receiver/order/loan/lists.php b/admin/views/receiver/order/loan/lists.php index 281c1533..5de05cdc 100644 --- a/admin/views/receiver/order/loan/lists.php +++ b/admin/views/receiver/order/loan/lists.php @@ -53,7 +53,7 @@
-
+
@@ -258,6 +258,7 @@ $("#title").val(''); $("#id-create-time").val(''); that.params.brand_id = ''; + that.params.city_id_admin = ''; } }, watch: {