This commit is contained in:
aozhiwei 2021-10-27 15:44:57 +08:00
commit 64a66472a7
2 changed files with 38 additions and 1 deletions

View File

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

View File

@ -640,6 +640,20 @@ class RoleController extends BaseAuthedController {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return;
}
phpcommon\SqlHelper::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()