1
This commit is contained in:
parent
d46dda27af
commit
3b9c559854
@ -36,6 +36,25 @@ use services\LogService;
|
|||||||
|
|
||||||
class HeroController extends BaseAuthedController {
|
class HeroController extends BaseAuthedController {
|
||||||
|
|
||||||
|
public function test(){
|
||||||
|
$heroUniId = getReqVal('hero_uniid', 0);
|
||||||
|
$heroDb = Hero::find($heroUniId);
|
||||||
|
if (!$heroDb) {
|
||||||
|
$this->_rspErr(100, 'param error or null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($heroDb['hero_lv'] == 15){
|
||||||
|
$this->_rspErr(100, 'param error or null');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$attrs = Hero::LvUpAddAttr($heroDb);
|
||||||
|
Hero::update($heroUniId, array(
|
||||||
|
'hero_lv' => $heroDb['hero_lv'] + 1,
|
||||||
|
'rand_attr' => json_encode($attrs['rand_attr']),
|
||||||
|
'base_attr' => json_encode($attrs['base_attr']),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
public function heroList()
|
public function heroList()
|
||||||
{
|
{
|
||||||
$heroList = array();
|
$heroList = array();
|
||||||
@ -111,7 +130,8 @@ class HeroController extends BaseAuthedController {
|
|||||||
$this->_rspErr(1, "You don't have the hero yet");
|
$this->_rspErr(1, "You don't have the hero yet");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$heroSkinDb) {
|
$itemMeta = \mt\Item::get($skinId);
|
||||||
|
if ($itemMeta['isdefaultskin'] != 1 && !$heroSkinDb) {
|
||||||
$this->_rspErr(2, "You don't have the skin yet");
|
$this->_rspErr(2, "You don't have the skin yet");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class HeroSkin extends BaseModel {
|
|||||||
'hero_id'=>0
|
'hero_id'=>0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
SqlHelper::update(
|
SqlHelper::upsert(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_hero_skin',
|
't_hero_skin',
|
||||||
array(
|
array(
|
||||||
@ -72,6 +72,17 @@ class HeroSkin extends BaseModel {
|
|||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'hero_id'=>$heroId
|
'hero_id'=>$heroId
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId(),
|
||||||
|
'skin_id' => $skinId,
|
||||||
|
'skin_state' => 0,
|
||||||
|
'get_from' => 0,
|
||||||
|
'consume_num' => 0,
|
||||||
|
'try_expire_at' => 0,
|
||||||
|
'hero_id' => $heroId,
|
||||||
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
'modifytime' => myself()->_getNowTime()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user