新增游戏自动授权

master
elf@home 4 years ago
parent f0aa844244
commit c40fbf3870

@ -237,6 +237,15 @@ class GameController extends ThinkController
]; ];
$gameService->saveBaseGame($baseData); $gameService->saveBaseGame($baseData);
M('promote_company', 'tab_')
->where('1=1')
->save(['game_ids' => ['exp', 'trim(BOTH "," FROM concat(game_ids, ",", ' . $res['relation_game_id'] . '))']]);
$subSql = M('promote_company', 'tab_')->field('id')->where(['company_belong' => ['not in', [1, 2]]])->select(false);
M('promote', 'tab_')
->where(['_string' => 'company_id in (' . $subSql . ')'])
->save(['game_ids' => ['exp', 'trim(BOTH "," FROM concat(game_ids, ",", ' . $res['id'] . '))']]);
\Think\Log::actionLog('Game/add', 'Game', 1); \Think\Log::actionLog('Game/add', 'Game', 1);
//操作日志 //操作日志
addOperationLog(array( addOperationLog(array(
@ -312,6 +321,11 @@ class GameController extends ThinkController
]; ];
$gameService->saveBaseGame($baseData); $gameService->saveBaseGame($baseData);
$subSql = M('promote_company', 'tab_')->field('id')->where(['company_belong' => ['in', [1, 2]]])->select(false);
M('promote', 'tab_')
->where(['_string' => 'company_id in (' . $subSql . ')'])
->save(['game_ids' => ['exp', 'trim(BOTH "," FROM concat(game_ids, ",", ' . $res['id'] . '))']]);
addOperationLog(array( addOperationLog(array(
"op_type"=>0, "op_type"=>0,
"key"=>$_POST['game_name'], "key"=>$_POST['game_name'],

@ -143,6 +143,7 @@ class GameModel extends Model{
}else{ }else{
if(!isset($data['relation_game_id'])){ if(!isset($data['relation_game_id'])){
$relation = M('Game','tab_')->where(array('id'=>$id))->save(array('relation_game_id'=>$id)); $relation = M('Game','tab_')->where(array('id'=>$id))->save(array('relation_game_id'=>$id));
$data['relation_game_id'] = $id;
if(!$relation){ if(!$relation){
$this->error('关联id添加失败');//游戏添加完成 $this->error('关联id添加失败');//游戏添加完成
} }

Loading…
Cancel
Save