From c4e2d0a2453a3d744e3ae8afb021f442b5e4285a Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Mon, 25 Nov 2019 17:51:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98OA=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 27 ++++++++++++++++--- Application/Admin/View/Promote/lists.html | 8 +++++- Data/update.sql | 4 +++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 56b360a3e..dc21c8ed7 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -63,16 +63,35 @@ unset($_REQUEST['parent_id']); $map['ba_id']=$_REQUEST['admin_id']; } } - if (I("promote_level")) { $map['level'] = I("promote_level"); } - $this->m_title = '推广员列表'; $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find()); + if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + $list_data = D(self::model_name)->where($map)->order('id DESC')->page($p,$row)->select(); + $arr['time'] = time(); + ksort($arr); + reset($arr); + $sign = md5(http_build_query($arr) . 'wmkjtx_kj213'); + $arr['sign'] = $sign; + $reData = curl_post('http://oa.76ba.com/api/wanmeng/platformAccount',$arr); + $reData = json_decode($reData,true)['data']; + $oa = array_column($reData, 'platform_account'); + foreach($list_data as $k => $v) + { + if($v['oa_associated'] != 1) { + $oa_val = in_array($v['account'], $oa) ? 1 : 0; + $list_data[$k]['oa_associated'] = $oa_val; + M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $oa_val]); + } + } + $count = D(self::model_name)->count(); + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + $this->assign('list_data', $list_data); + $this->display(); - - parent::order_lists(self::model_name,$p,$map); } private function siteApplyList($p){ diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 49a901191..635fa6215 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -172,7 +172,8 @@ 所属会长 商务专员 状态 - 身份状态> + 身份状态 + oa-关联 可申请游戏 操作 @@ -225,6 +226,11 @@ 未认证 + + 已关联 + + 未关联 + 查看 编辑 diff --git a/Data/update.sql b/Data/update.sql index c4a608160..0f679bb80 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -547,3 +547,7 @@ ALTER TABLE `tab_withdraw` ADD COLUMN `last_up_update_time` int(10) NOT NULL DEFAULT 0 COMMENT '最后更新时间', ADD COLUMN `spend_ids` longtext NOT NULL COMMENT '充值订单id'; + +--推广员添加oa关联 +ALTER TABLE `tab_promote` +ADD COLUMN`oa_associated` tinyint(1) DEFAULT '0' COMMENT 'oa是否关联',