推广员OA关联

master
zhanglingsheng 5 years ago
parent 5c264a7e08
commit c4e2d0a245

@ -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){

@ -172,7 +172,8 @@
<th>所属会长</th>
<th>商务专员</th>
<th>状态</th>
<th>身份状态</th>>
<th>身份状态</th>
<th>oa-关联</th>
<th>可申请游戏</th>
<th>操作</th>
</tr>
@ -225,6 +226,11 @@
<span>未认证</span>
<?php }?>
</td>
<if condition="$data['oa_associated'] eq 1">
<td>已关联</td>
<else />
<td style="color: red;">未关联</td>
</if>
<td><a class="ajax-view" data-id="{$data.id}">查看</a></td>
<td>
<a href="{:U('edit',array('id'=>$data['id']))}" class="">编辑</a>

@ -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是否关联',

Loading…
Cancel
Save