测试资源

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 { if(!empty(I('server_name'))){
foreach ($rs as $rsKey => $rsValue) { $map['tab_test_resource.server_name']=I('server_name');
$id = $rsValue['id']; }
$childPromoteIds .= $id.','; if(!empty(I('game_name'))){
} $map['tab_test_resource.game_name']=I('game_name');
$childPromoteIds = rtrim($childPromoteIds, ','); }
$childPromoteIds .= ',' . PID; if(!empty(I('role_name'))){
$map['tab_test_resource.promote_id'] = ['in', $childPromoteIds]; $map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
} }
if(!empty(I('user_account'))){
if(!empty(I('server_name'))){ $map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
$map['tab_test_resource.server_name']=I('server_name'); }
} if(!empty(I('promote_id'))){
if(!empty(I('game_name'))){ $map['tab_test_resource.promote_id']=I('promote_id');
$map['tab_test_resource.game_name']=I('game_name'); }
}
if(!empty(I('role_name'))){
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
}
if(!empty(I('user_account'))){
$map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
}
if(!empty(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();

Loading…
Cancel
Save