diff --git a/Application/Admin/Controller/PaymentMerchantController.class.php b/Application/Admin/Controller/PaymentMerchantController.class.php index 0e4ec3abf..caf9137ef 100644 --- a/Application/Admin/Controller/PaymentMerchantController.class.php +++ b/Application/Admin/Controller/PaymentMerchantController.class.php @@ -882,9 +882,12 @@ class PaymentMerchantController extends ThinkController public function saveMasterRule() { try { + + $userAuth = session('user_auth'); + $params = I('post.'); $service = new PaymentRuleService(); - $service->saveGameMasterMerchantRule($params); + $service->saveGameMasterMerchantRule($params, $userAuth); $this->ajaxReturn([ 'status' => 1, @@ -933,12 +936,16 @@ class PaymentMerchantController extends ThinkController $admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select(); $admins = index_by_column('id', $admins); + $gameService = new GameService(); + $games = $gameService->getBaseGames(); + $gameNameMap = array_column($games, 'id', 'name'); + $records = []; foreach ($items as $item) { $records[] = [ 'id' => $item['id'], 'base_game_id' => $item['base_game_id'], - 'base_game_name' => $item['base_game_name'], + 'base_game_name' => $gameNameMap[$item['base_game_id']] ?: '', 'is_first_pay' => $item['is_first_pay'], 'max_times' => $item['max_times'], 'max_pay_amount' => $item['max_pay_amount'], @@ -953,9 +960,6 @@ class PaymentMerchantController extends ThinkController $this->assign('_page', $page); } - $gameService = new GameService(); - $games = $gameService->getBaseGames(); - $this->assign('games', $games); $this->assign('records', $records); $this->assign('admins', $admins); diff --git a/Application/Admin/View/PaymentMerchant/masterRules.html b/Application/Admin/View/PaymentMerchant/masterRules.html index 3dc591379..060a73c6c 100644 --- a/Application/Admin/View/PaymentMerchant/masterRules.html +++ b/Application/Admin/View/PaymentMerchant/masterRules.html @@ -138,14 +138,14 @@ {$data.base_game_name} - {$data.is_first_pay} + {$data.max_times} {$data.max_pay_amount} {$data.update_time}
编辑 - 删除 + 删除
diff --git a/Application/Base/Service/PaymentRuleService.class.php b/Application/Base/Service/PaymentRuleService.class.php index f0294a2e4..c58304b2d 100644 --- a/Application/Base/Service/PaymentRuleService.class.php +++ b/Application/Base/Service/PaymentRuleService.class.php @@ -120,7 +120,7 @@ class PaymentRuleService return $records; } - public function saveGameMasterMerchantRule($params) + public function saveGameMasterMerchantRule($params, $user) { if (empty($params['base_game_id'])) { throw new Exception('请选择游戏'); @@ -130,6 +130,7 @@ class PaymentRuleService 'is_first_pay' => $params['is_first_pay'] ?: 0, 'max_times' => $params['max_times'] ?: 0, 'max_pay_amount' => $params['max_pay_amount'] ?: 0, + 'admin_id' => $user['uid'], 'update_time' => time(), ];