game2006api/webapp/controller/BattleController.class.php
aozhiwei c2e04dce01 1
2022-04-01 08:34:20 +08:00

47 lines
1.1 KiB
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();
}
public function getBattleData()
{
error_log(json_encode($_REQUEST));
myself()->_rspData(array(
'hero_id' => 1245678
));
}
}