测试资源

master
sunke 5 years ago
parent bcb71c25cb
commit 9df85a49d4

@ -481,17 +481,7 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = ''; $childPromoteIds = '';
if(empty($rs)) { $map['tab_test_resource.promote_id'] = PID;
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
if(!empty(I('role_name'))){ if(!empty(I('role_name'))){
$map['role_name']=['like','%'.I('role_name').'%']; $map['role_name']=['like','%'.I('role_name').'%'];
@ -547,17 +537,7 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = ''; $childPromoteIds = '';
if(empty($rs)) { $map['tab_test_resource.promote_id'] = PID;
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
if(!empty(I('type'))||I('type')==='0'){ if(!empty(I('type'))||I('type')==='0'){
$map['apply_status']=I('type'); $map['apply_status']=I('type');
@ -617,33 +597,23 @@ class DownloadController extends BaseController {
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = ''; $childPromoteIds = '';
if(empty($rs)) { $map['tab_test_resource.promote_id'] = PID;
$map['tab_test_resource.promote_id'] = PID;
}else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id.',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds];
}
if(!empty(I('server_name'))){ if(!empty(I('server_name'))){
$map['tab_test_resource.server_name']=I('server_name'); $map['tab_test_resource.server_name']=I('server_name');
} }
if(!empty(I('game_name'))){ if(!empty(I('game_name'))){
$map['tab_test_resource.game_name']=I('game_name'); $map['tab_test_resource.game_name']=I('game_name');
} }
if(!empty(I('role_name'))){ if(!empty(I('role_name'))){
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%']; $map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
} }
if(!empty(I('user_account'))){ if(!empty(I('user_account'))){
$map['tab_test_resource.user_account']=['like','%'.I('user_account').'%']; $map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
} }
if(!empty(I('promote_id'))){ if(!empty(I('promote_id'))){
$map['tab_test_resource.promote_id']=I('promote_id'); $map['tab_test_resource.promote_id']=I('promote_id');
} }
$conditions = json_encode($map,TRUE); $conditions = json_encode($map,TRUE);
$addtime = time(); $addtime = time();
@ -852,7 +822,7 @@ class DownloadController extends BaseController {
} }
$levelPromote = $this->getLevelPromote(); $levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote); $queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [ $map2[] = [
'_logic' => 'or', '_logic' => 'or',
'id' => $queryPromote['id'], 'id' => $queryPromote['id'],

Loading…
Cancel
Save