|
|
|
@ -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();
|
|
|
|
|