master
elf 2 years ago
parent 96c5beb80d
commit e28360d75c

@ -882,9 +882,12 @@ class PaymentMerchantController extends ThinkController
public function saveMasterRule() public function saveMasterRule()
{ {
try { try {
$userAuth = session('user_auth');
$params = I('post.'); $params = I('post.');
$service = new PaymentRuleService(); $service = new PaymentRuleService();
$service->saveGameMasterMerchantRule($params); $service->saveGameMasterMerchantRule($params, $userAuth);
$this->ajaxReturn([ $this->ajaxReturn([
'status' => 1, 'status' => 1,
@ -933,12 +936,16 @@ class PaymentMerchantController extends ThinkController
$admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select(); $admins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select();
$admins = index_by_column('id', $admins); $admins = index_by_column('id', $admins);
$gameService = new GameService();
$games = $gameService->getBaseGames();
$gameNameMap = array_column($games, 'id', 'name');
$records = []; $records = [];
foreach ($items as $item) { foreach ($items as $item) {
$records[] = [ $records[] = [
'id' => $item['id'], 'id' => $item['id'],
'base_game_id' => $item['base_game_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'], 'is_first_pay' => $item['is_first_pay'],
'max_times' => $item['max_times'], 'max_times' => $item['max_times'],
'max_pay_amount' => $item['max_pay_amount'], 'max_pay_amount' => $item['max_pay_amount'],
@ -953,9 +960,6 @@ class PaymentMerchantController extends ThinkController
$this->assign('_page', $page); $this->assign('_page', $page);
} }
$gameService = new GameService();
$games = $gameService->getBaseGames();
$this->assign('games', $games); $this->assign('games', $games);
$this->assign('records', $records); $this->assign('records', $records);
$this->assign('admins', $admins); $this->assign('admins', $admins);

@ -138,14 +138,14 @@
<volist name="records" id="data"> <volist name="records" id="data">
<tr data-id="<?=$data['id']?>"> <tr data-id="<?=$data['id']?>">
<td>{$data.base_game_name}</td> <td>{$data.base_game_name}</td>
<td>{$data.is_first_pay}</td> <td><?=$data['is_first_pay'] == 0 ? '关闭' : '开启'?></td>
<td>{$data.max_times}</td> <td>{$data.max_times}</td>
<td>{$data.max_pay_amount}</td> <td>{$data.max_pay_amount}</td>
<td>{$data.update_time}</td> <td>{$data.update_time}</td>
<td> <td>
<div class="partakebtn"> <div class="partakebtn">
<a class="edit-form-btn" href="javascript:;">编辑</a> <a class="edit-form-btn" href="javascript:;">编辑</a>
<a class="delet-btn" href="javascript:;">删除</a> <a class="delete-btn" href="javascript:;">删除</a>
</div> </div>
</td> </td>
</tr> </tr>

@ -120,7 +120,7 @@ class PaymentRuleService
return $records; return $records;
} }
public function saveGameMasterMerchantRule($params) public function saveGameMasterMerchantRule($params, $user)
{ {
if (empty($params['base_game_id'])) { if (empty($params['base_game_id'])) {
throw new Exception('请选择游戏'); throw new Exception('请选择游戏');
@ -130,6 +130,7 @@ class PaymentRuleService
'is_first_pay' => $params['is_first_pay'] ?: 0, 'is_first_pay' => $params['is_first_pay'] ?: 0,
'max_times' => $params['max_times'] ?: 0, 'max_times' => $params['max_times'] ?: 0,
'max_pay_amount' => $params['max_pay_amount'] ?: 0, 'max_pay_amount' => $params['max_pay_amount'] ?: 0,
'admin_id' => $user['uid'],
'update_time' => time(), 'update_time' => time(),
]; ];

Loading…
Cancel
Save