game2006api/webapp/controller/BattleController.class.php
2022-02-12 14:58:40 +08:00

39 lines
967 B
PHP

<?php
require_once('services/BattleDataService.php');
use phpcommon\SqlHelper;
class BattleController extends BaseAuthedController {
public function preBattleCheck()
{
$this->_rspData(array(
'pre_battle_payload' => ''
));
}
public function battleReport()
{
$userInfo = $this->_getOrmUserInfo();
if (!$userInfo) {
$this->_rspErr(1, 'Without this player1');
return;
}
$battleDataService = new services\BattleDataService();
$battleDataService->updateBattleData();
SqlHelper::insert(
$this->_getSelfMysql(),
't_battle_record',
array(
'account_id' => $this->_getAccountId(),
'request' => json_encode($_REQUEST),
'createtime' => $this->_getNowTime(),
'modifytime' => $this->_getNowTime(),
)
);
$this->_rspOk();
}
}