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