Merge branch 'james_bc' of git.kingsome.cn:server/game2006api into james_bc

This commit is contained in:
hujiabin 2022-11-21 14:23:25 +08:00
commit d0f53c7707
3 changed files with 85 additions and 2 deletions

View File

@ -652,6 +652,25 @@ CREATE TABLE `t_realtime_data` (
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_battle_settlement`
--
DROP TABLE IF EXISTS `t_battle_settlement`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_battle_settlement` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`battle_uniid` varchar(60) NOT NULL DEFAULT '' COMMENT '战斗记录唯一id',
`account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id',
`data` mediumblob COMMENT 'data',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `account_id_battle_uniid` (`account_id`, `battle_uniid`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Table structure for table `t_battle_history` -- Table structure for table `t_battle_history`
-- --
@ -835,7 +854,6 @@ CREATE TABLE `t_nft_up_event` (
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `t_nft_up_receive`; DROP TABLE IF EXISTS `t_nft_up_receive`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;

View File

@ -4,6 +4,7 @@ require_once('models/Hero.php');
require_once('models/Gun.php'); require_once('models/Gun.php');
require_once('models/Chip.php'); require_once('models/Chip.php');
require_once('models/Bag.php'); require_once('models/Bag.php');
require_once('models/BattleSettlement.php');
require_once('models/BattleHistory.php'); require_once('models/BattleHistory.php');
require_once('services/BattleDataService.php'); require_once('services/BattleDataService.php');
require_once('services/FormulaService.php'); require_once('services/FormulaService.php');
@ -14,6 +15,7 @@ use models\Hero;
use models\Gun; use models\Gun;
use models\Bag; use models\Bag;
use models\BattleHistory; use models\BattleHistory;
use models\BattleSettlement;
class BattleController extends BaseAuthedController { class BattleController extends BaseAuthedController {
@ -39,7 +41,7 @@ class BattleController extends BaseAuthedController {
} }
$channelId = phpcommon\extractChannel($account_id); $channelId = phpcommon\extractChannel($account_id);
if ($chnanelId == SELFSDK_CHANNEL) { if ($chnanelId == SELFSDK_CHANNEL || $account_id == '') {
//则是机器人 //则是机器人
} }
*/ */
@ -52,6 +54,10 @@ class BattleController extends BaseAuthedController {
return; return;
} }
$data = json_decode(file_get_contents('php://input'), true); $data = json_decode(file_get_contents('php://input'), true);
/*error_log(json_encode(array(
'a' => 'battleReport',
'post_data' => $data
)));*/
$teamList = array(); $teamList = array();
if ($data) { if ($data) {
$teamList = $data['team_list']; $teamList = $data['team_list'];
@ -142,6 +148,21 @@ class BattleController extends BaseAuthedController {
$this->_rspData($data); $this->_rspData($data);
} }
/*
http post
php://input
{
}
*/
public function reportSettlement()
{
$battleUuid = getReqVal('battle_uuid', '');
$data = file_get_contents('php://input');
BattleSettlement::add($battleUuid, $data);
myself()->_rspOk();
}
public function getBattleData() public function getBattleData()
{ {
$mode = getReqVal('mode', ''); $mode = getReqVal('mode', '');

View File

@ -0,0 +1,44 @@
<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class BattleSettlement extends BaseModel
{
public static function add($battleUuid, $data)
{
SqlHelper::upsert
(myself()->_getSelfMysql(),
't_battle_settlement',
array(
'account_id' => myself()->_getAccountId(),
'battle_uniid' => $battleUuid,
),
array(
),
array(
'account_id' => myself()->_getAccountId(),
'battle_uniid' => $battleUuid,
'data' => $data,
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(),
)
);
}
public static function find($battleUuid)
{
$row = SqlHelper::selectOne
(myself()->_getSelfMysql(),
't_battle_settlement',
array(
'account_id' => myself()->_getAccountId(),
'battle_uniid' => $battleUuid,
)
);
return $row;
}
}