From b9d8b539e04df6e7051f447d940dd83cdf453f16 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 25 Oct 2021 14:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=A6=96=E6=88=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../controller/BaseAuthedController.class.php | 23 +++++++++++++++++++ webapp/controller/RoleController.class.php | 16 ++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bf9fe5f..68f6149 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ config __pycache__/ res out/ +public/ \ No newline at end of file diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 37f0325..9eebeae 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -79,6 +79,29 @@ class BaseAuthedController extends BaseController { return $r; } + protected function rspErr($errno, $errmsg) + { + echo json_encode(array( + 'errno' => $errno, + 'errmsg' => $errmsg + )); + } + + protected function rspOk() + { + echo json_encode(array( + 'errno' => 0, + 'errmsg' => '' + )); + } + + protected function rspData($data) + { + $data['errno'] = 0; + $data['errmsg'] = ''; + echo json_encode($data); + } + protected function isValidSex($sex) { return in_array($sex, array(0, 1, 2)); diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index edc1d96..e2d9208 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -640,6 +640,20 @@ class RoleController extends BaseAuthedController { phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); return; } + phpcommon\SqlHelerp::update + ($conn, + 'user', + array( + 'accountid' => $account_id, + ), + array( + 'first_fight' => function () { + return '1'; + } + ) + ); + $this->rspOk(); + /* $rank = $_REQUEST['rank']; //排名 $kills = $_REQUEST['kills']; //击杀数 $harm = $_REQUEST['harm']; //伤害 @@ -809,7 +823,7 @@ class RoleController extends BaseAuthedController { 'errcode' => 0, 'errmsg' => '', )); - + */ } public function battleReport()