From 99ca6527442e561d0b97b71e77cb0ea9b6442928 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Fri, 3 Dec 2021 14:18:07 +0800 Subject: [PATCH] edit-admin-order_list --- admin/libraries/OrdersList.php | 140 +++++++-------------------------- 1 file changed, 28 insertions(+), 112 deletions(-) diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index f0e814c8..0cf498f5 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -181,11 +181,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -197,23 +196,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -395,11 +383,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -411,23 +398,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -628,11 +604,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -644,23 +619,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -815,11 +779,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -831,23 +794,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -1030,11 +982,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -1046,23 +997,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -1236,11 +1176,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -1252,23 +1191,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = ''; @@ -1441,11 +1369,10 @@ class OrdersList if ($params['admin_id']) { $where['admin_id'] = $params['admin_id']; } else { - $where_lcb = array(); if ($params['biz_id_admin']) {//指定店铺所有销售员 - $where_lcb['biz_id'] = $params['biz_id_admin']; + $where['biz_id'] = $params['biz_id_admin']; } else { - //指定城市的所有销售员 + //指定城市的所有门店 $where_biz = array(); if ($params['county_id_admin']) { $where_biz['county_id'] = $params['county_id_admin']; @@ -1457,23 +1384,12 @@ class OrdersList $rows_biz = $this->ci->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; + $where["biz_id in({$str_ids})"] = null; } else { - $where_lcb['biz_id'] = -1; + $where['biz_id'] = -1; } } } - //获取目标销售员列表 - if ($where_lcb) { - $where_lcb['status>-1'] = null; - $rows_lcb = $this->ci->mdLichebUsers->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'] = '';