|
|
@ -503,7 +503,6 @@ class GameRebateService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
$data = [
|
|
|
|
'base_game_id' => $params['base_game_id'],
|
|
|
|
|
|
|
|
'ref_id' => $params['ref_id'],
|
|
|
|
'ref_id' => $params['ref_id'],
|
|
|
|
'name' => $params['name'],
|
|
|
|
'name' => $params['name'],
|
|
|
|
'value' => $params['value'],
|
|
|
|
'value' => $params['value'],
|
|
|
@ -513,6 +512,7 @@ class GameRebateService
|
|
|
|
if ($id > 0) {
|
|
|
|
if ($id > 0) {
|
|
|
|
M('rebate_props', 'tab_')->where(['id' => $id])->save($data);
|
|
|
|
M('rebate_props', 'tab_')->where(['id' => $id])->save($data);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$data['base_game_id'] = $params['base_game_id'] ?? 0;
|
|
|
|
$data['create_time'] = time();
|
|
|
|
$data['create_time'] = time();
|
|
|
|
M('rebate_props', 'tab_')->add($data);
|
|
|
|
M('rebate_props', 'tab_')->add($data);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -592,6 +592,26 @@ class GameRebateService
|
|
|
|
throw new \Exception('请选择游戏');
|
|
|
|
throw new \Exception('请选择游戏');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($defaultTimes)) {
|
|
|
|
|
|
|
|
throw new \Exception('默认倍数格式错误');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($maxTimes)) {
|
|
|
|
|
|
|
|
throw new \Exception('倍数上限格式错误');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$defaultTimes = intval($defaultTimes);
|
|
|
|
|
|
|
|
$maxTimes = intval($maxTimes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($defaultTimes < 0) {
|
|
|
|
|
|
|
|
throw new \Exception('默认倍数需大于0');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($maxTimes < 0) {
|
|
|
|
|
|
|
|
throw new \Exception('倍数上限需大于0');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$setting = M('rebate_times_setting', 'tab_')->where(['base_game_id' => $baseGameId, 'type' => $type])->find();
|
|
|
|
$setting = M('rebate_times_setting', 'tab_')->where(['base_game_id' => $baseGameId, 'type' => $type])->find();
|
|
|
|
|
|
|
|
|
|
|
|
// $baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
|
|
|
|
// $baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
|
|
|
@ -743,7 +763,7 @@ class GameRebateService
|
|
|
|
'pay_amount' => $dailyPayAmount,
|
|
|
|
'pay_amount' => $dailyPayAmount,
|
|
|
|
'gift_key' => 'J-0',
|
|
|
|
'gift_key' => 'J-0',
|
|
|
|
'gift_content' => $this->getGiftContentByProps($applyProps),
|
|
|
|
'gift_content' => $this->getGiftContentByProps($applyProps),
|
|
|
|
'props' => json_encode($applyProps),
|
|
|
|
'props' => json_encode($applyProps, JSON_UNESCAPED_UNICODE),
|
|
|
|
'times' => $setting['max_times'],
|
|
|
|
'times' => $setting['max_times'],
|
|
|
|
'create_time' => time(),
|
|
|
|
'create_time' => time(),
|
|
|
|
];
|
|
|
|
];
|
|
|
|