From df1d3ae2b5c70e2b42bd02d223143923ce336e4e Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Sun, 30 Sep 2018 11:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=E9=A1=B5=E7=AE=80=E5=8C=96=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/agent/AgentManage.php | 2 +- application/admin/model/wechat/WechatUser.php | 43 +++++ .../admin/view/wechat/wechat_user/index.php | 156 +----------------- 3 files changed, 50 insertions(+), 151 deletions(-) diff --git a/application/admin/controller/agent/AgentManage.php b/application/admin/controller/agent/AgentManage.php index fcac6257..39a6ba02 100644 --- a/application/admin/controller/agent/AgentManage.php +++ b/application/admin/controller/agent/AgentManage.php @@ -57,7 +57,7 @@ class AgentManage extends AuthController ]; $uidAll = UserModel::getAll($where); $this->assign(compact('limitTimeList','uidAll')); - $this->assign(UserModel::systemPage($where)); + $this->assign(UserModel::agentSystemPage($where)); return $this->fetch(); } diff --git a/application/admin/model/wechat/WechatUser.php b/application/admin/model/wechat/WechatUser.php index 3a0f928e..99821250 100644 --- a/application/admin/model/wechat/WechatUser.php +++ b/application/admin/model/wechat/WechatUser.php @@ -102,6 +102,49 @@ use service\SystemConfigService; * @return array */ public static function systemPage($where = array(),$isall=false){ + $model = new self; + $model = $model->where('openid','NOT NULL'); + if($where['nickname'] !== '') $model = $model->where('nickname','LIKE',"%$where[nickname]%"); + if($where['data'] !== ''){ + list($startTime,$endTime) = explode(' - ',$where['data']); + $model = $model->where('add_time','>',strtotime($startTime)); + $model = $model->where('add_time','<',strtotime($endTime)); + } + if(isset($where['tagid_list']) && $where['tagid_list'] !== ''){ + $tagid_list = explode(',',$where['tagid_list']); + foreach ($tagid_list as $v){ + $model = $model->where('tagid_list','LIKE',"%$v%"); + } + } + if(isset($where['groupid']) && $where['groupid'] !== '-1' ) $model = $model->where('groupid',"$where[groupid]"); + if(isset($where['sex']) && $where['sex'] !== '' ) $model = $model->where('sex',"$where[sex]"); + if(isset($where['subscribe']) && $where['subscribe'] !== '' ) $model = $model->where('subscribe',"$where[subscribe]"); + $model = $model->order('uid desc'); + if(isset($where['export']) && $where['export'] == 1){ + $list = $model->select()->toArray(); + $export = []; + foreach ($list as $index=>$item){ + $export[] = [ + $item['nickname'], + $item['sex'], + $item['country'].$item['province'].$item['city'], + $item['subscribe'] == 1? '关注':'未关注', + ]; + $list[$index] = $item; + } + PHPExcelService::setExcelHeader(['名称','性别','地区','是否关注公众号']) + ->setExcelTile('微信用户导出','微信用户导出'.time(),' 生成时间:'.date('Y-m-d H:i:s',time())) + ->setExcelContent($export) + ->ExcelSave(); + } + return self::page($model,$where); + } +/** + * 获取分销用户 + * @param array $where + * @return array + */ + public static function agentSystemPage($where = array(),$isall=false){ self::setWechatUserOrder();//设置 一级推荐人 二级推荐人 一级推荐人订单 二级推荐人订单 佣金 $model = new self; if($isall==false) { diff --git a/application/admin/view/wechat/wechat_user/index.php b/application/admin/view/wechat/wechat_user/index.php index f61802b5..bfdceb99 100644 --- a/application/admin/view/wechat/wechat_user/index.php +++ b/application/admin/view/wechat/wechat_user/index.php @@ -164,131 +164,7 @@ 地区 - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- +
- 推广二维码 +
- - - {$vo.second} - - - {$vo.order_stair} - - - {$vo.order_second} - - - - + + + {if condition="$vo['subscribe']"} 关注 @@ -401,9 +259,7 @@ 未关注 {/if} - - {$vo.nickname} - +