推广员oa关联

master
zhanglingsheng 5 years ago
parent 3002dc113a
commit e59352edbf

@ -69,25 +69,38 @@ unset($_REQUEST['parent_id']);
$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;}
if(!empty(I('oa_associated'))) {
$oa_data = [];
for($i = 1; $i > 0; $i++) {
$arr['time'] = time();
$arr['page'] = $i;
$arr['pageSize'] = 1000;
ksort($arr);
reset($arr);
$sign = md5(http_build_query($arr) . 'wmkjtx_kj213');
$arr['sign'] = $sign;
$re_data = curl_post('http://oa.76ba.com/api/wanmeng/platformAccount',$arr);
$re_data = json_decode($re_data,true);
if($re_data['code'] == 1) {
$oa = $re_data['data'];
$oa_data = array_merge($oa_data,$oa);
} else {
break;
}
}
$promote = D(self::model_name)->field('id,account')->where(['oa_associated' => 0])->order('id DESC')->select();
$oa_data = array_column($oa_data, 'platform_account');
foreach($promote as $k => $v) {
if(in_array($v['account'], $oa_data)) {
M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => 1]);
}
}
}
$list_data = D(self::model_name)->where($map)->order('id DESC')->page($p,$row)->select();
// $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)
{
@ -103,14 +116,14 @@ unset($_REQUEST['parent_id']);
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'];
$re_data = curl_post('http://oa.76ba.com/api/wanmeng/verifyBind',$arr);
$re_data = json_decode($re_data,true)['data'];
foreach($list_data as $k => $v)
{
if(in_array($v['account'], $reData))
if(in_array($v['account'], $re_data))
{
$list_data[$k]['oa_associated'] = $reData[$v['account']];
M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $reData[$v['account']]]);
$list_data[$k]['oa_associated'] = $re_data[$v['account']];
M('promote','tab_')->where(['id' => $v['id']])->setField(['oa_associated' => $re_data[$v['account']]]);
}
}
}

@ -126,7 +126,14 @@
<option value="3">审核中</option>
<option value="4">修改审核中</option>
</select>
</div>
</div>
<div class="input-list input-list-channelstatus">
<select name="oa_associated">
<option value="">oa关联</option>
<option value="1">已关联</option>
<option value="2">未关联</option>
</select>
</div>
<else/>
<div class="input-list input-list-channelstatus">
<select name="url_type">
@ -142,6 +149,13 @@
<option value="2">未审核</option>
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="oa_associated">
<option value="">oa关联</option>
<option value="1">已关联</option>
<option value="2">未关联</option>
</select>
</div>
</empty>
<input type="hidden" name="" value="" class="sortBy">
<input type="hidden" name="type" value="{$_GET['type']}">

Loading…
Cancel
Save