From 988bf9908637a9f9546aa7a4270873f9a416318e Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Mon, 25 Nov 2019 19:26:52 +0800 Subject: [PATCH] ss --- .../Controller/PromoteController.class.php | 50 +++++++++++++++---- Application/Admin/View/Promote/lists.html | 2 +- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index dc21c8ed7..f4d55f041 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -70,20 +70,48 @@ unset($_REQUEST['parent_id']); $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'); + // $arr['time'] = time(); + // $arr['page'] = 1; + // $arr['pageSize'] = 1000; + // 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]); + // } + // } + $oa_data = []; 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]); + $oa_data[] = $v['account']; + } + } + if(!empty($oa_data)) + { + $arr['time'] = time(); + $arr['account'] = implode(",", $oa_data); + ksort($arr); + reset($arr); + $sign = md5(http_build_query($arr) . 'wmkjtx_kj213'); + $arr['sign'] = $sign; + $reData = curl_post('http://oa.76ba.com/api/wanmeng/verifyBind',$arr); + $reData = json_decode($reData,true)['data']; + foreach($list_data as $k => $v) + { + if(in_array($v['account'], $reData)) + { + $list_data[$k]['oa_associated'] = $reData[$v['account']]; + M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $reData[$v['account']]]); + } } } $count = D(self::model_name)->count(); diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 635fa6215..7d94de0d4 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -173,7 +173,7 @@ 商务专员 状态 身份状态 - oa-关联 + oa关联 可申请游戏 操作