批量添加下级游戏bug修复

master
chenxiaojun 5 years ago
commit 6fa45ff033

@ -1622,7 +1622,7 @@ class ApplyController extends BaseController
$newPromoteData = [];
if (count($promoteIds) > 0) {
foreach ($promoteIds as $value) {
$thisPromote = M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id']))->count('id');
$thisPromote = M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id');
if (!$thisPromote) {
$newPromoteData[] = $value;
@ -1667,15 +1667,24 @@ class ApplyController extends BaseController
$this->ajaxReturn($data);
}
$save['game_id'] = $gameId;
$save['game_name'] = get_game_name($gameId);
$save['promote_id'] = $value;
$save['promote_account'] = session("promote_auth.account");
$map['game_id'] = $gameId;
$map['promote_id'] = $value;
$applyData = M('apply', 'tab_')->field('id,offline_status')->where($map)->find();
$updateStatus = 0;
if (!empty($applyData)) {
if ($applyData['offline_status'] == 0) {
continue;
} else {
$updateStatus = 1;
}
}
$save['promote_account'] = $thisPromoteData['account'];
$save['apply_time'] = NOW_TIME;
$save['status'] = C('SET_AUTO_PACK');
$save['sdk_version'] = $gameData['sdk_version'];
$save['ratio'] = $gameData['ratio'];
$save['money'] = $gameData['money'];
$save['offline_status'] = 0;
$gameSource = M('Game_source', 'tab_')->field('id,source_version')->where(['game_id' => $gameId])->find();
if (!file_exists(get_game_source_file_url($gameId)) || null == $gameSource) {
@ -1684,7 +1693,17 @@ class ApplyController extends BaseController
$save['enable_status'] = 2;
}
if ($updateStatus == 0) {
$save['sdk_version'] = $gameData['sdk_version'];
$save['game_id'] = $gameId;
$save['game_name'] = get_game_name($gameId);
$save['promote_id'] = $value;
$save['status'] = C('SET_AUTO_PACK');
$res = M('Apply', 'tab_')->add($save);
} else {
$res = M('Apply', 'tab_')->where('id = ' . $applyData['id'])->save($save);
}
if (!$res) {
$this->ajaxReturn(array("status" => -1, "msg" => "添加失败", 'ret' => $res));
@ -1708,7 +1727,8 @@ class ApplyController extends BaseController
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
public function backDetailData() { //返回详情数据
public function backDetailData()
{ //返回详情数据
$result = ['code' => 10001, 'msg' => "该游戏信息不存在,请确认!", 'error' => 1, 'info' => ''];
$id = $_POST['id'];
if (empty($id)) {

Loading…
Cancel
Save