master
elf 2 years ago
parent 96c5beb80d
commit e28360d75c

@ -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);

@ -138,14 +138,14 @@
<volist name="records" id="data">
<tr data-id="<?=$data['id']?>">
<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_pay_amount}</td>
<td>{$data.update_time}</td>
<td>
<div class="partakebtn">
<a class="edit-form-btn" href="javascript:;">编辑</a>
<a class="delet-btn" href="javascript:;">删除</a>
<a class="delete-btn" href="javascript:;">删除</a>
</div>
</td>
</tr>

@ -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(),
];

Loading…
Cancel
Save