1
This commit is contained in:
parent
d28b0234e0
commit
68af6f64a6
14
doc/Other.py
14
doc/Other.py
@ -17,6 +17,20 @@ class Other(object):
|
||||
_common.RspHead(),
|
||||
['!list', [Tag()], '红点列表']
|
||||
]
|
||||
},{
|
||||
'name': 'cancelTag',
|
||||
'desc': '红点提示',
|
||||
'group': 'Other',
|
||||
'url': 'webapp/index.php?c=Other&a=cancelTag',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['type', '', '1:英雄 2:芯片 3:背包 5:算力'],
|
||||
['item_unnid', '', 'item_unnid'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'getGameModuleState',
|
||||
|
@ -18,6 +18,9 @@ require_once('models/SeasonRanking.php');
|
||||
require_once('models/RewardsCec.php');
|
||||
require_once('models/GlobalData.php');
|
||||
require_once('models/HashRate.php');
|
||||
require_once('models/Hero.php');
|
||||
require_once('models/Chip.php');
|
||||
require_once('models/Bag.php');
|
||||
|
||||
use models\SignLog;
|
||||
use phpcommon\SqlHelper;
|
||||
@ -30,6 +33,9 @@ use models\SeasonRanking;
|
||||
use models\RewardsCec;
|
||||
use models\GlobalData;
|
||||
use models\HashRate;
|
||||
use models\Hero;
|
||||
use models\Chip;
|
||||
use models\Bag;
|
||||
|
||||
class OtherController extends BaseAuthedController {
|
||||
const HERO = 1;
|
||||
@ -121,6 +127,73 @@ class OtherController extends BaseAuthedController {
|
||||
));
|
||||
}
|
||||
|
||||
public function cancelTag()
|
||||
{
|
||||
$type = getReqVal('type', 0);
|
||||
$unnid = getReqVal('item_unnid', 0);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
switch ($type) {
|
||||
case self::HERO :{
|
||||
$heroDb = Hero::find($unnid);
|
||||
if (!$heroDb){
|
||||
$this->_rspErr(1, 'param item_unnid error');
|
||||
return;
|
||||
}
|
||||
Hero::update($unnid,array(
|
||||
'is_new' => 1
|
||||
));
|
||||
$propertyChgService->addHeroChg();
|
||||
}
|
||||
break;
|
||||
case self::CHIP :{
|
||||
$chipDb = Chip::find($unnid);
|
||||
if (!$chipDb){
|
||||
$this->_rspErr(2, 'param item_unnid error');
|
||||
return;
|
||||
}
|
||||
Chip::update2($unnid,array(
|
||||
'is_new' => 1
|
||||
));
|
||||
$propertyChgService->addChip();
|
||||
}
|
||||
break;
|
||||
case self::BAG :{
|
||||
$bagDb = Bag::findByUniId($unnid);
|
||||
if (!$bagDb){
|
||||
$this->_rspErr(3, 'param item_unnid error');
|
||||
return;
|
||||
}
|
||||
SqlHelper::update
|
||||
(myself()->_getSelfMysql(),
|
||||
't_bag',
|
||||
array(
|
||||
'idx' => $unnid,
|
||||
),
|
||||
array(
|
||||
'is_new' => 1
|
||||
)
|
||||
);
|
||||
$propertyChgService->addBagChg();
|
||||
}
|
||||
break;
|
||||
case self::HASH_RATE :{
|
||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||
if ($currentPeriod) {
|
||||
$myHashRate = HashRate::getMyHashRate($currentPeriod['id']);
|
||||
myself()->_setV(TN_TOTAL_HASH_RATE_REWARD,$currentPeriod['id'], $myHashRate);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:{
|
||||
$this->_rspErr(4, 'param type error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->_rspData(array(
|
||||
'property_chg' => $propertyChgService->toDto()
|
||||
));
|
||||
}
|
||||
|
||||
public function getGameModuleState(){
|
||||
//七日签到
|
||||
$signState = 0;
|
||||
|
@ -182,7 +182,6 @@ class HashRateService extends BaseService
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
);
|
||||
HashRate::add($fieldKv);
|
||||
myself()->_incV(TN_TOTAL_HASH_RATE_REWARD,$currentPeriod['id'], $taskMate['Reward_quantity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user