From ddd7b9805fa7c86daa729e2806d0d06e4c74a9f3 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 12 Oct 2019 15:39:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E6=B8=B8=E6=88=8Fbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/ApplyController.class.php | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 85b6c74f5..a5f239089 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -1568,15 +1568,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) { @@ -1585,7 +1594,17 @@ class ApplyController extends BaseController $save['enable_status'] = 2; } - $res = M('Apply', 'tab_')->add($save); + 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)); From 7f7d054dfc8fc99ae0a20fff7d7f3c65f8954b63 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 12 Oct 2019 15:41:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E6=B8=B8=E6=88=8Fbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/ApplyController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index a5f239089..b25dc092c 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -1523,7 +1523,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;