diff --git a/admin/controllers/app/licheb/Channel.php b/admin/controllers/app/licheb/Channel.php new file mode 100644 index 00000000..2ca53e84 --- /dev/null +++ b/admin/controllers/app/licheb/Channel.php @@ -0,0 +1,155 @@ +load->model('app/licheb/App_licheb_users_model', 'mdUsers'); + $this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz'); + $this->load->model('receiver/receiver_customers_model', 'mdCustomers'); + $this->load->model('receiver/order/receiver_orders_model', 'mdOrders'); + $this->load->model("biz/biz_model", 'mdBiz'); + $this->load->model("area_model", 'mdArea'); + } + + //首页信息 + public function index() + { + $this->lists(); + } + + //数据列表 + public function lists() + { + $params = $this->input->get(); + $params['page'] = $params['page'] ? intval($params['page']) : 1; + $params['size'] = $params['size'] ? intval($params['size']) : 20; + $lists = []; + $where['group_id'] = 4; + if ($params['uname']) { + $where['uname like "%' . $params['uname'] . '%"'] = null; + } + if ($params['mobile']) { + $where['mobile like "%' . $params['mobile'] . '%"'] = null; + } + $count = $this->mdUsers->count($where); + if ($count) { + $fileds = "id,uname,mobile,c_time"; + $res = $this->mdUsers->select($where, "id desc", $params['page'], $params['size'], $fileds); + foreach ($res as $key => $value) { + $setValue = []; + $bizs = $this->db->select('lc_app_licheb_channel_biz.biz_id') + ->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left') + ->where(['lc_app_licheb_channel_biz.uid' => $value['id'], 'lc_biz.status' => 1]) + ->count_all_results('lc_app_licheb_channel_biz'); + $setValue['id'] = $value['id']; + $setValue['uname'] = $value['uname']; + $setValue['mobile'] = $value['mobile']; + $setValue['bizs'] = $bizs; + $setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']); + $lists[] = $setValue; + } + } + $this->data['lists'] = $lists; + $this->data['params'] = $params; + $this->data['_title'] = '渠道列表'; + $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); + return $this->show_view('/app/licheb/channel/lists', true); + } + + public function lists_biz() + { + $params = $this->input->get(); + if (!$params['uid']) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $params['page'] = $params['page'] ? intval($params['page']) : 1; + $params['size'] = $params['size'] ? intval($params['size']) : 20; + $re = $this->mdUsers->get(array('id' => $params['uid'])); + $lists = []; + $where['lc_app_licheb_channel_biz.uid'] = $params['uid']; + $where['lc_biz.status'] = 1; + !$params['city_id'] && $params['city_id'] = ''; + !$params['county_id'] && $params['county_id'] = ''; + if ($params['biz_name']) { + $where['lc_biz.biz_name like "%' . $params['biz_name'] . '%"'] = null; + } + if ($params['city_id']) { + $where['lc_biz.city_id'] = $params['city_id']; + } + if ($params['county_id']) { + $where['lc_biz.county_id'] = $params['county_id']; + } + $count = $this->db->select('lc_app_licheb_channel_biz.biz_id') + ->join('lc_biz', 'lc_biz.id = lc_app_licheb_channel_biz.biz_id', 'left') + ->where($where) + ->count_all_results('lc_app_licheb_channel_biz'); + if ($count) { + $offset = ($params['page'] - 1) * $params['size']; + $limit = $params['size']; + $this->db->from('lc_app_licheb_channel_biz'); + $this->db->join('lc_biz', "lc_biz.id = lc_app_licheb_channel_biz.biz_id", 'left'); + $this->db->select('lc_biz.id,lc_biz.biz_name,lc_biz.county_id,lc_biz.c_time'); + $this->db->where($where); + $this->db->order_by('lc_app_licheb_channel_biz.id Desc'); + $this->db->limit($limit, $offset); + $res = $this->db->get()->result_array(); + $county_id_arr = array_unique(array_column($res, 'county_id')); + $Areas = $this->mdArea->get_map_by_county_ids($county_id_arr, 'city_name,county_name,county_id', 'county_id'); + foreach ($res as $key => $value) { + $setValue = []; + $county = $Areas[$value['county_id']][0]; + $setValue['biz_name'] = $value['biz_name']; + $setValue['county_name'] = $county ? $county['city_name'] . '-' . $county['county_name'] : ''; + $setValue['wjkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 0]); + $setValue['dtkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'dt_time<>' => '0000-00-00 00:00:00']); + $setValue['ddkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 2]); + $setValue['zbkhs'] = $this->mdCustomers->count(['biz_id' => $value['id'], 'status' => 3]); + $setValue['orders'] = $this->mdOrders->count(['biz_id' => $value['id'], 'status>=' => 0, 'brand_id<>' => 3, 'biz_id<>' => 1]); + $setValue['days'] = round((time() - $value['c_time']) / 3600 / 24) . '天'; + $lists[] = $setValue; + } + } + $this->data['lists'] = $lists; + $this->data['params'] = $params; + $this->data['_title'] = $re['uname'] . '_门店列表'; + $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); + return $this->show_view('/app/licheb/channel/lists_biz', true); + } + + //展示单条数据 + public function get() + { + } + + //添加单条数据 + public function add() + { + } + + //编辑单条数据 + public function edit() + { + } + + //删除单条数据 + public function del() + { + + } + + //批量操作(默认修改状态) + public function batch() + { + + } + + //导出数据列表 + public function export() + { + + } +} diff --git a/admin/controllers/app/licheb/Main.php b/admin/controllers/app/licheb/Main.php index f8761832..12778a68 100644 --- a/admin/controllers/app/licheb/Main.php +++ b/admin/controllers/app/licheb/Main.php @@ -35,6 +35,14 @@ class Main extends HD_Controller array('name' => '查看详情', 'url' => '/app/licheb/member/index'), ), ); + $value = $this->userM->count(['group_id' => 4]); + $list[] = array( + 'title' => '渠道列表(人)', + 'value' => $value, + 'btns' => array( + array('name' => '查看详情', 'url' => '/app/licheb/channel'), + ), + ); $value = $this->mdTemplate->count(); $list[] = array( 'title' => '素材模版(个)', diff --git a/admin/controllers/app/licheb/Member.php b/admin/controllers/app/licheb/Member.php index caa80180..3c75f46b 100755 --- a/admin/controllers/app/licheb/Member.php +++ b/admin/controllers/app/licheb/Member.php @@ -2,14 +2,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); -class Member extends HD_Controller{ +class Member extends HD_Controller +{ - private $groups = [1=>'销售',2=>'店长',3=>'老板',4=>'渠道经理']; + private $groups = [1 => '销售', 2 => '店长', 3 => '老板', 4 => '渠道经理']; public function __construct() { parent::__construct(); $this->load->model('app/licheb/App_licheb_users_model', 'userM'); + $this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz'); $this->load->model("biz/biz_model"); } @@ -35,7 +37,11 @@ class Member extends HD_Controller{ $where['mobile'] = $params['mobile']; $this->data['mobile'] = $params['mobile']; } - if($params['biz_id']){ + if ($params['group_id']) { + $where['group_id'] = $params['group_id']; + $this->data['group_id'] = $params['group_id']; + } + if ($params['biz_id']) { $where['biz_id'] = $params['biz_id']; } else { $params['city_id'] = ''; @@ -44,23 +50,20 @@ class Member extends HD_Controller{ } $count = $this->userM->count($where); - $lists = $this->userM->select($where,'id desc',$page,$size); - foreach($lists as $key=>$val){ - $bizs = []; - $biz_id_arr = explode(',',$val['biz_id']); - if($biz_id_arr){ - $ids = implode(',',$biz_id_arr); - $b_where = [ - "id in ($ids)" => null - ]; - $bizs = $this->biz_model->select($b_where,'',0,0,'biz_name'); + $lists = $this->userM->select($where, 'id desc', $page, $size); + foreach ($lists as $key => $val) { + $biz_name = ''; + if ($val['group_id'] == 4) { + $biz_name = ' 门店列表'; + } else if ($val['biz_id']) { + $re_biz = $this->biz_model->get(['id' => $val['biz_id'], 'status' => 1], 'biz_name'); + $re_biz && $biz_name = $re_biz['biz_name']; } - $lists[$key]['bizs'] = $bizs; + $lists[$key]['biz_name'] = $biz_name; $lists[$key]['group_name'] = $this->groups[$val['group_id']]; - - if(SUPER_ADMIN == $this->role){//超级管理员才允许操作用户的披上超级马甲 + if (SUPER_ADMIN == $this->role) {//超级管理员才允许操作用户的披上超级马甲 $majia = array(); - if($val['jsondata']){ + if ($val['jsondata']) { $json = json_decode($val['jsondata'], true); $majia = $json['majia'] ? $json['majia'] : array(); } @@ -70,6 +73,7 @@ class Member extends HD_Controller{ $this->data['app_id'] = 2; $this->data['params'] = $params; $this->data['lists'] = $lists; + $this->data['groupAry'] = $this->groups; $this->data['_title'] = '用户列表'; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); @@ -80,50 +84,61 @@ class Member extends HD_Controller{ //展示单条数据 public function get() { + $this->load->model("sys/sys_city_model", 'mdSysCity'); $id = $this->input->get('id'); - $row = $this->userM->get(['id'=>$id]); + $row = $this->userM->get(['id' => $id]); $selectedBrands = []; - if($id){ + if ($id) { $info = array( 'id' => $row['id'], 'uname' => $row['uname'], 'mobile' => $row['mobile'], 'group_id' => $row['group_id'], 'biz_id' => $row['biz_id'], - 'city_id' => 0, - 'county_id' => 0 + 'city_id' => $row['city_id'], ); - $biz_id_arr = explode(',',$row['biz_id']); - if($biz_id_arr){ - $ids = implode(',',$biz_id_arr); - $where = [ - "id in ($ids)" => null - ]; - $selectedBrands = $this->biz_model->select($where,'',0,0,'id as biz_id,biz_name as name'); + if ($row['group_id'] == 4) { + $this->load->model('app/licheb/App_licheb_channel_biz_model', 'mdChannelBiz'); + $res_biz = $this->mdChannelBiz->select(['uid' => $id], 'id desc', 0, 0, 'biz_id'); + $res_biz && $biz_id_arr = array_unique(array_column($res_biz, 'biz_id')); + if ($res_biz) { + $biz_id_arr = array_unique(array_column($res_biz, 'biz_id')); + $ids = implode(',', $biz_id_arr); + $selectedBrands = $this->biz_model->select(["id in ($ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name'); + } + } else if ($row['biz_id']) { + $re_biz = $this->biz_model->get(["id" => $row['biz_id'], 'status' => 1], 'id ,biz_name'); + if ($re_biz) { + $selectedBrands[] = ['biz_id' => $re_biz['id'], 'name' => $re_biz['biz_name']]; + } } $action = '/app/licheb/member/edit'; $_title = '编辑用户'; } else { - $info = array('biz_id' => '', 'group_id' => '','city_id'=>0,'county_id'=>0); + $info = array('biz_id' => '', 'group_id' => '', 'city_id' => 0); $action = '/app/licheb/member/add'; $_title = '添加用户'; } + $show_info['cityList'] = $this->mdSysCity->select(['status' => 1], 'id desc', 0, 0, 'city_id,name'); $this->data['selectedBrands'] = $selectedBrands; + $this->data['show_info'] = $show_info; $this->data['info'] = $info; $this->data['groups'] = $this->groups; $this->data['action'] = $action; $this->data['_title'] = $_title; - return $this->show_view('app/licheb/member/get',true); + return $this->show_view('app/licheb/member/get', true); } //添加单条数据 - public function add(){ + public function add() + { $info = $this->input->post('info'); $uname = $info['uname']; $mobile = $info['mobile']; $group_id = $info['group_id']; $bizs = $info['bizs']; - $biz_id_arr = array_column($bizs,'biz_id'); + $city_id = $info['city_id']; + $biz_id_arr = array_column($bizs, 'biz_id'); if (!mobile_valid($mobile)) { return $this->show_json(SYS_CODE_FAIL, '输入正确手机号'); @@ -140,13 +155,16 @@ class Member extends HD_Controller{ $add = array( 'mobile' => $mobile, 'uname' => $uname, + 'city_id' => $city_id, 'status' => 1, 'c_time' => time(), ); $group_id && $add['group_id'] = $group_id; - $biz_id_arr && $add['biz_id'] = implode(',',$biz_id_arr); + $biz_id_arr && $add['biz_id'] = implode(',', $biz_id_arr); $id = $this->userM->add($add); - + if ($id && $group_id == 4 && $biz_id_arr) {//加狸车宝渠道门店 + $this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr]); + } return $this->show_json(SYS_CODE_SUCCESS, '操作成功', '/app/licheb/member'); } @@ -160,7 +178,8 @@ class Member extends HD_Controller{ $mobile = $info['mobile']; $group_id = $info['group_id']; $bizs = $info['bizs']; - $biz_id_arr = is_array($bizs) ? array_column($bizs,'biz_id') : ''; + $city_id = $info['city_id']; + $biz_id_arr = is_array($bizs) ? array_column($bizs, 'biz_id') : ''; if (!mobile_valid($mobile)) { return $this->show_json(SYS_CODE_FAIL, '输入正确手机号'); @@ -173,16 +192,19 @@ class Member extends HD_Controller{ $upd = array( 'mobile' => $mobile, + 'city_id' => $city_id, ); $upd['group_id'] = $group_id ? $group_id : 0; - $upd['biz_id'] = $biz_id_arr ? implode(',',$biz_id_arr) : 0; + $upd['biz_id'] = $biz_id_arr ? implode(',', $biz_id_arr) : 0; $nickname && $upd['nickname'] = $nickname; $uname && $upd['uname'] = $uname; $this->userM->update($upd, array('id' => $id)); - + if ($id && $group_id == 4) {//加狸车宝渠道门店 + $this->channel_biz(["uid" => $id, 'biz_id_arr' => $biz_id_arr, 'edit' => 1]); + } return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); } @@ -223,14 +245,15 @@ class Member extends HD_Controller{ } - function json_lists(){ + function json_lists() + { $biz_id = $this->input->post('biz_id'); $status = $this->input->post('status'); $page = $this->input->post('page'); $size = $this->input->post('size'); $where = array(); - if(strlen($status) > 0){ + if (strlen($status) > 0) { $where['status'] = $status; } else { $whre['status > -1'] = null; @@ -240,12 +263,12 @@ class Member extends HD_Controller{ $total = $this->userM->count($where); $lists = array(); - if($total){ + if ($total) { $orderby = 'id desc'; $select = 'id,uname'; $rows = $this->userM->select($where, $orderby, $page, $size, $select); - foreach($rows as $v){ + foreach ($rows as $v) { $lists[] = array( 'id' => $v['id'], 'title' => $v['uname'], @@ -256,4 +279,150 @@ class Member extends HD_Controller{ $this->data = array('total' => $total, 'list' => $lists); return $this->show_json(SYS_CODE_SUCCESS); } + + /** + * Notes:加狸车宝渠道门店 + * Created on: 2021/11/12 14:54 + * Created by: dengbw + * @param array $json + */ + function channel_biz($json = []) + { + $biz_ids = $json['biz_id_arr'] ? implode(',', $json['biz_id_arr']) : 0; + if ($json['edit'] == 1) {//编辑删除未添加的 + $where_d['uid'] = $json['uid']; + $biz_ids && $where_d["biz_id not in({$biz_ids})"] = null; + $this->mdChannelBiz->delete($where_d); + } + if (!$biz_ids) { + return; + } + $res_b = $this->biz_model->select(["id in({$biz_ids})" => null], '', 0, 0, 'id as biz_id'); + foreach ($res_b as $key => $value) { + $where = ["uid" => $json['uid'], 'biz_id' => $value['biz_id']]; + $re_cb = $this->mdChannelBiz->get($where); + if (!$re_cb) { + $where['c_time'] = time(); + $this->mdChannelBiz->add($where); + } + } + } + + /** + * Notes:获取门店渠道经理 + * Created on: 2021/11/15 11:31 + * Created by: dengbw + * @return bool + */ + function get_channel_uid() + { + $biz_id = $this->input->get('biz_id'); + if (!$biz_id) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $res_b = $this->mdChannelBiz->select(["biz_id" => $biz_id], '', 0, 0, 'uid'); + $this->data = $res_b ? array_column($res_b, 'uid') : []; + return $this->show_json(SYS_CODE_SUCCESS); + } + + /** + * Notes:保存渠道管理员 + * Created on: 2021/11/15 15:54 + * Created by: dengbw + * @return bool + */ + function edit_channel_uid() + { + $biz_id = $this->input->post('biz_id'); + $channel_uid = $this->input->post('channel_uid'); + if (!$biz_id) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $re_biz = $this->biz_model->get(['id' => $biz_id]); + if (!$re_biz) { + return $this->show_json(SYS_CODE_FAIL, '店铺不存在!'); + } + $where_del['biz_id'] = $biz_id; + if ($channel_uid) { + $channel_uid_str = implode(',', $channel_uid); + $where_del["uid not in({$channel_uid_str})"] = null; + } + $res_b = $this->mdChannelBiz->select($where_del, '', 0, 0, 'uid'); //临时 + $this->mdChannelBiz->delete($where_del); + //临时 + foreach ($res_b as $key => $value) { + $res_b2 = $this->mdChannelBiz->select(['uid' => $value['uid']], '', 0, 0, 'biz_id'); + $biz_id = $res_b2 ? array_unique(array_column($res_b2, 'biz_id')) : 0; + $biz_id && $biz_id = implode(',', $biz_id); + $this->userM->update(['biz_id' => $biz_id], ['id' => $value['uid']]); + } + //临时 + if ($channel_uid) { + foreach ($channel_uid as $key => $value) { + $uid = $value; + $where = ["uid" => $uid, 'biz_id' => $biz_id]; + $re_cb = $this->mdChannelBiz->get($where); + if (!$re_cb) { + $where['c_time'] = time(); + $this->mdChannelBiz->add($where); + //临时 + $res_b2 = $this->mdChannelBiz->select(['uid' => $uid], '', 0, 0, 'biz_id'); + $biz_id = $res_b2 ? array_unique(array_column($res_b2, 'biz_id')) : 0; + $biz_id && $biz_id = implode(',', $biz_id); + $this->userM->update(['biz_id' => $biz_id], ['id' => $uid]); + //临时 + } + } + } + return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); + } + + /** + * Notes:获取门店管理员 + * Created on: 2021/11/15 17:33 + * Created by: dengbw + * @return bool + */ + function get_users_group() + { + $group_id = $this->input->get('group_id'); + $biz_id = $this->input->get('biz_id'); + $admin_name = $this->input->get('admin_name'); + if (!$group_id || !$biz_id) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + $where = ["group_id" => $group_id, 'status >' => -1]; + $admin_name && $where['uname like "%' . $admin_name . '%"'] = null; + $res_u = $this->userM->select($where, '', 0, 0, 'id,uname as name'); + $res_u2 = $this->userM->select(array_merge($where, ['biz_id' => $biz_id]), '', 0, 0, 'id'); + $this->data['admins'] = $res_u ? $res_u : []; + $this->data['admin_id'] = $res_u2 ? array_column($res_u2, 'id') : []; + return $this->show_json(SYS_CODE_SUCCESS); + } + + /** + * Notes:保存门店管理员 + * Created on: 2021/11/15 17:33 + * Created by: dengbw + * @return bool + */ + function edit_users_group() + { + $biz_manage = $this->input->post('biz_manage'); + if (!$biz_manage['biz_id']) { + return $this->show_json(SYS_CODE_FAIL, '参数错误'); + } + if (!$biz_manage['admin_name']) { + $where_del = ['biz_id' => $biz_manage['biz_id'], 'group_id' => $biz_manage['group_id']]; + if ($biz_manage['admin_id']) { + $admin_id_str = implode(',', $biz_manage['admin_id']); + $where_del["id not in({$admin_id_str})"] = null; + } + $this->userM->update(["biz_id" => 0], $where_del); + } + foreach ($biz_manage['admin_id'] as $key => $value) { + $this->userM->update(["biz_id" => $biz_manage['biz_id']], ['id' => $value]); + } + return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); + } } diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 26a03ed9..c9ffce90 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -71,12 +71,7 @@ class Customer extends HD_Controller $params['cf_title'] && $where['cf_title'] = $params['cf_title']; $params['brand_id'] && $where['brand_id'] = $params['brand_id']; if ($params['qdjl_id']) { - $re_bu = $this->app_licheb_users_model->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } //销售员筛选 if ($params['admin_id']) { diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index 07ff3eea..79c9c5c0 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -130,12 +130,7 @@ class OrdersList $where["payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } if ($params['title']) { $where["{$params['search_tp']} like '%{$params['title']}%'"] = null; @@ -336,12 +331,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { @@ -582,12 +572,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { @@ -772,12 +757,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { @@ -980,12 +960,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { @@ -1189,12 +1164,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { @@ -1397,12 +1367,7 @@ class OrdersList $where["{$t2}.payway"] = $params['payway']; } if ($params['qdjl_id']) {//渠道经理 - $re_bu = $this->ci->mdLichebUsers->get(array('id' => $params['qdjl_id'])); - if ($re_bu['biz_id']) { - $where["biz_id in({$re_bu['biz_id']})"] = null; - } else { - $where['biz_id'] = -1; - } + $where["$t2.biz_id in(select biz_id from lc_app_licheb_channel_biz where uid={$params['qdjl_id']})"] = null; } $statusAry = $this->ci->mdOrders->statusAry($status_pid); if ($params['list_type'] == 'all') { diff --git a/admin/views/app/licheb/channel/lists.php b/admin/views/app/licheb/channel/lists.php new file mode 100644 index 00000000..45fc0b12 --- /dev/null +++ b/admin/views/app/licheb/channel/lists.php @@ -0,0 +1,171 @@ +
+ +
+
共有条数据
+ + + + + + + + + + + + + + + + + + + + + + + +
ID姓名手机号码门店数创建时间操作
门店列表
+
+
+ +
+ +
+
+
+ diff --git a/admin/views/app/licheb/channel/lists_biz.php b/admin/views/app/licheb/channel/lists_biz.php new file mode 100644 index 00000000..6550b7b5 --- /dev/null +++ b/admin/views/app/licheb/channel/lists_biz.php @@ -0,0 +1,136 @@ +
+ +
+
共有条数据
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
门店地区未见客户数到店客户数订单客户数战败客户数订单数创建时间
+
+
+ +
+ +
+
+
+ diff --git a/admin/views/app/licheb/member/get.php b/admin/views/app/licheb/member/get.php index f54557f6..7049720c 100755 --- a/admin/views/app/licheb/member/get.php +++ b/admin/views/app/licheb/member/get.php @@ -1,15 +1,16 @@ -
- + +
- +
- +
@@ -21,18 +22,31 @@
+
+ +
+ +
+
- +
-
+
+ +