|
|
|
@ -1231,16 +1231,23 @@ class PromoteController extends ThinkController
|
|
|
|
|
$promote = M('promote', 'tab_')->field('id,account,game_ids,company_id')->where(['id'=>$promoteId])->find();
|
|
|
|
|
$company = M('promote_company', 'tab_')->field('game_ids')->where(['id' => $promote['company_id']])->find();
|
|
|
|
|
$data = [];
|
|
|
|
|
if (!$company || $company['game_ids'] == '') {
|
|
|
|
|
if (is_null($company)) {
|
|
|
|
|
$games = M('game', 'tab_')
|
|
|
|
|
->field('relation_game_id id,relation_game_name game_name,short')
|
|
|
|
|
->where(['game_status'=>1, 'down_port'=>1])
|
|
|
|
|
->group("relation_game_id")
|
|
|
|
|
->select();
|
|
|
|
|
$data['data']['game_list'] = empty($games) ? '' : $games;
|
|
|
|
|
} elseif ($company['game_ids'] == '') {
|
|
|
|
|
$data['data']['game_list'] = [];
|
|
|
|
|
} else {
|
|
|
|
|
$companyGameIds = explode(',', $company['game_ids']);
|
|
|
|
|
$game_list = M('game', 'tab_')
|
|
|
|
|
$games = M('game', 'tab_')
|
|
|
|
|
->field('relation_game_id id,relation_game_name game_name,short')
|
|
|
|
|
->where(['game_status'=>1, 'down_port'=>1, 'id' => ['in', $companyGameIds]])
|
|
|
|
|
->group("relation_game_id")
|
|
|
|
|
->select();
|
|
|
|
|
$data['data']['game_list'] = empty($game_list) ? '' : $game_list;
|
|
|
|
|
$data['data']['game_list'] = empty($games) ? '' : $games;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (empty($promote['game_ids'])) {
|
|
|
|
|