优化修改推广游戏操作日志

master
chenzhi 4 years ago
parent 74d9d6ed18
commit 2d0bba8de5

@ -1189,6 +1189,9 @@ class PromoteCompanyController extends ThinkController
$is_change_game = false; $is_change_game = false;
$Promote = M("Promote", "tab_"); $Promote = M("Promote", "tab_");
if($old_info['game_ids'] != $game_ids){ if($old_info['game_ids'] != $game_ids){
//操作日志
$this->addCompanyGameChangeLog($company_id,$old_info['game_ids'],$game_ids);
if($old_info['company_belong'] == 1 || $old_info['company_belong'] == 2){ if($old_info['company_belong'] == 1 || $old_info['company_belong'] == 2){
//外团跟随公司 //外团跟随公司
$new_game_ids = D("Game")->changeRelationGameidToGameid($game_ids,true); $new_game_ids = D("Game")->changeRelationGameidToGameid($game_ids,true);
@ -1228,6 +1231,20 @@ class PromoteCompanyController extends ThinkController
} }
} }
} }
protected function addCompanyGameChangeLog($company_id,$old_game_ids,$new_game_ids){
$old_game_ids = explode(',',$old_game_ids);
$new_game_ids = explode(',',$new_game_ids);
$addGameid = array_diff($new_game_ids,$old_game_ids);
$removeGameid = array_diff($old_game_ids,$new_game_ids);
if(!empty($addGameid)){
$gameid = implode(',',$addGameid);
addOperationLog(['op_type'=>1,'key'=>"addCompanyGame","op_name"=>"新增推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]);
}
if(!empty($removeGameid)){
$gameid = implode(',',$removeGameid);
addOperationLog(['op_type'=>1,'key'=>"removeCompanyGame","op_name"=>"移除推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]);
}
}
/** /**
* 由于修改公司信息引起的会长信息修改 * 由于修改公司信息引起的会长信息修改
* @param [type] $save * @param [type] $save

Loading…
Cancel
Save