10) { return json_error([],'玩家RTP区间不能超过10个'); } $userInfo = $this->getUserInfo(); $info = GameControlAutoRTPConfigModel::where(['app_id' => $userInfo['merchant_id']])->find(); if(empty($info)){ return json_error([],'参数错误'); } $info->float_rate = bcmul( $float_rate , 100) * 1; $info->new_user_number = $new_user_number; foreach ($rtp_kill_data as $idx => $item) { $item['new'] = ($item['new'] ?? 0) * 100; $item['old'] = ($item['old'] ?? 0) * 100; $rtp_kill_data[$idx] = $item; } $info->rtp_kill_data = json_encode( $rtp_kill_data); $info->save(); return json_success([]); } /** * 获取自动RTP配置 * @return \think\response\Json */ public function getAutoRTPConfigInfo() { $userInfo = $this->getUserInfo(); $autoRtpConfig = GameControlAutoRTPConfigModel::getAutoRTPConfigInfo($userInfo['merchant_id']); if(empty($autoRtpConfig)){ return json_success([ 'total' => 0, 'list' => [] ]); } return json_success([ 'total' => 1, 'list' => [$autoRtpConfig] ]); } /** * 更新自动RTP配置状态 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function updateAutoRTPStatus() { $status = Request::post("status", 0, "trim"); $id = Request::post("id", 0, "trim"); if(empty($id)){ return json_error([],'参数错误'); } $info = GameControlAutoRTPConfigModel::find($id); if(empty($info)){ return json_error([],'参数错误'); } $info->status = $status; $info->save(); return json_success(); } }