1
This commit is contained in:
parent
f37d62cfe9
commit
b4eda8b18b
@ -238,6 +238,7 @@ CREATE TABLE `t_battle` (
|
||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
||||
`battle_data` mediumblob COMMENT 'battle_data',
|
||||
`kills_modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '击杀修改时间',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
|
@ -43,7 +43,7 @@ class Battle extends BaseModel {
|
||||
|
||||
public static function update($fieldsKv)
|
||||
{
|
||||
SqlHelper::upsert
|
||||
SqlHelper::update
|
||||
(myself()->_getSelfMysql(),
|
||||
't_battle',
|
||||
array(
|
||||
|
@ -105,7 +105,7 @@ class Hero extends BaseModel {
|
||||
|
||||
public static function update($heroId, $fieldsKv)
|
||||
{
|
||||
SqlHelper::upsert
|
||||
SqlHelper::update
|
||||
(myself()->_getSelfMysql(),
|
||||
't_hero',
|
||||
array(
|
||||
|
@ -6,17 +6,19 @@ require_once('mt/Item.php');
|
||||
require_once('mt/Equip.php');
|
||||
require_once('mt/Season.php');
|
||||
require_once('mt/Rank.php');
|
||||
require_once('mt/Param.php');
|
||||
require_once('mt/Parameter.php');
|
||||
|
||||
require_once('models/Season.php');
|
||||
require_once('models/Battle.php');
|
||||
require_once('models/Bag.php');
|
||||
require_once('models/Hero.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Season;
|
||||
use models\Battle;
|
||||
use models\Bag;
|
||||
use models\Hero;
|
||||
|
||||
class BattleDataService extends BaseService {
|
||||
|
||||
@ -24,13 +26,17 @@ class BattleDataService extends BaseService {
|
||||
|
||||
public function updateBattleData()
|
||||
{
|
||||
error_log(json_encode($_REQUEST));
|
||||
error_log('updateBattleData1');
|
||||
if (!$this->decCost()) {
|
||||
return;
|
||||
}
|
||||
error_log('updateBattleData2');
|
||||
$this->currSeasonMeta = mt\Season::getCurrentSeason();
|
||||
if (!$this->currSeasonMeta) {
|
||||
return;
|
||||
}
|
||||
error_log('updateBattleData3');
|
||||
$this->seasonDb = Season::find($this->currSeasonMeta['id']);
|
||||
if (!$this->seasonDb) {
|
||||
Season::add($this->currSeasonMeta['id']);
|
||||
@ -39,6 +45,7 @@ class BattleDataService extends BaseService {
|
||||
if (!$this->seasonDb) {
|
||||
return;
|
||||
}
|
||||
error_log('updateBattleData4');
|
||||
$this->updateScore();
|
||||
$hisBattleData = Battle::getMyBattleData();
|
||||
if (!isset($hisBattleData)) {
|
||||
@ -299,7 +306,7 @@ class BattleDataService extends BaseService {
|
||||
return false;
|
||||
}
|
||||
$costTili = mt\Parameter::getVal('cost_fatigue', 0);
|
||||
if ($heroDB['tili'] < $costTili) {
|
||||
if ($heroDb['hero_tili'] < $costTili) {
|
||||
return false;
|
||||
}
|
||||
Hero::update($heroDb['hero_id'], array(
|
||||
@ -313,6 +320,7 @@ class BattleDataService extends BaseService {
|
||||
private function addItems()
|
||||
{
|
||||
$tmpStrs1 = explode('|', getReqVal('items', ''));
|
||||
error_log('addItems ' . getReqVal('items', ''));
|
||||
foreach ($tmpStrs1 as $tmpStr) {
|
||||
$tmpStrs2 = explode(':', $tmpStr);
|
||||
if (count($tmpStrs2) >= 2) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user