This commit is contained in:
hujiabin 2023-07-16 11:20:50 +08:00
parent 3445871a1d
commit 0f9b9a604b

View File

@ -36,24 +36,24 @@ use services\LogService;
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 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()
{