diff --git a/webapp/controller/CallbackController.class.php b/webapp/controller/CallbackController.class.php index b92e861c..f790640e 100644 --- a/webapp/controller/CallbackController.class.php +++ b/webapp/controller/CallbackController.class.php @@ -205,8 +205,14 @@ class CallbackController extends BaseController { 'modifytime' => myself()->_getNowTime(), ) ); + if ($heroDb['quality'] + 1 > $this->_getDynDataV(TN_HERO_MAX_QUALITY, 0)) { + $this->_setDynDataV(TN_HERO_MAX_QUALITY, 0, $heroDb['quality'] + 1); + } myself()->_rspOk(); } + + + public function gunUpgradeQuality(){ $transId = getReqVal('trans_id', '0'); $tokenId = getReqVal('token_id', '0'); @@ -262,6 +268,9 @@ class CallbackController extends BaseController { 'modifytime' => myself()->_getNowTime(), ) ); + if ($gunDb['quality'] + 1 > $this->_getDynDataV(TN_GUN_MAX_QUALITY, 0)) { + $this->_setDynDataV(TN_GUN_MAX_QUALITY, 0, $gunDb['quality'] + 1); + } myself()->_rspOk(); } @@ -330,4 +339,39 @@ class CallbackController extends BaseController { myself()->_rspOk(); } + private function _getDynDataV($x, $y, $val = 0){ + SqlHelper::ormSelectOne( + myself()->_getMysql($this->accountId), + 't_dyndata', + array( + 'account_id' => $this->accountId, + 'x' => $x, + 'y' => $y, + ) + ); + } + private function _setDynDataV($x, $y, $val = 0){ + SqlHelper::upsert + (myself()->_getMysql($this->accountId), + 't_dyndata', + array( + 'account_id' => $this->accountId, + 'x' => $x, + 'y' => $y + ), + array( + 'val' => $val, + 'modifytime' => myself()->_getNowTime() + ), + array( + 'account_id' => $this->accountId, + 'x' => $x, + 'y' => $y, + 'val' => $val, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime() + ) + ); + } + } diff --git a/webapp/services/MissionService.php b/webapp/services/MissionService.php index 28d5c416..a8c8a434 100644 --- a/webapp/services/MissionService.php +++ b/webapp/services/MissionService.php @@ -581,7 +581,11 @@ class MissionService extends BaseService { 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), 'sendtime' => 0, - 'objects' => array() + 'objects' => array(), + "awards" => array( + V_ITEM_GOLD, + mt\Drop::get($meta['reward'])?mt\Drop::get($meta['reward'])['item_id']:0 + ) )); } } @@ -792,16 +796,15 @@ class MissionService extends BaseService { )); } $cegNum = $this->calcCegPreview($objects); - $data = array( - array( + $data = array(); + if ($objects){ + array_push($data,array( 'item_id'=> V_ITEM_GOLD, 'item_num'=> $cegNum, - ) - ); - if ($objects){ + )); array_push($data, array( 'item_id'=> $dropMeta['item_id'], - 'item_num'=> 1, + 'item_num'=> $dropMeta['num'], )); } myself()->_rspData(array(