[游戏管理]游戏实时对局
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace app\admin\controller\game;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\service\GamePeriodService;
|
||||
use app\common\service\GameRecordService;
|
||||
use support\Response;
|
||||
use Throwable;
|
||||
use Webman\Http\Request as WebmanRequest;
|
||||
@@ -29,7 +29,7 @@ class Period extends Backend
|
||||
|
||||
protected function initController(WebmanRequest $request): ?Response
|
||||
{
|
||||
$this->model = new \app\common\model\GamePeriod();
|
||||
$this->model = new \app\common\model\GameRecord();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class Period extends Backend
|
||||
}
|
||||
$method = $request->method();
|
||||
if ($method === 'GET') {
|
||||
return $this->success('', GamePeriodService::getPeriodSettings());
|
||||
return $this->success('', GameRecordService::getRecordSettings());
|
||||
}
|
||||
if ($method === 'POST') {
|
||||
$data = $request->post();
|
||||
@@ -52,7 +52,7 @@ class Period extends Backend
|
||||
return $this->error(__('Parameter %s can not be empty', ['']));
|
||||
}
|
||||
try {
|
||||
GamePeriodService::savePeriodSettings($data);
|
||||
GameRecordService::saveRecordSettings($data);
|
||||
} catch (Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class Period extends Backend
|
||||
if ($request->method() !== 'POST') {
|
||||
return $this->error(__('Parameter error'));
|
||||
}
|
||||
$result = GamePeriodService::createNextPeriodForManual();
|
||||
$result = GameRecordService::createNextRecordForManual();
|
||||
if ($result['ok']) {
|
||||
return $this->success($result['msg'], ['period_no' => $result['period_no'] ?? '']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user