1
This commit is contained in:
parent
7cd25ba963
commit
84c951e2b8
@ -140,7 +140,7 @@ class HeroController extends BaseAuthedController {
|
||||
$this->_rspErr(1, "Not enough hero skill points");
|
||||
return;
|
||||
}
|
||||
Hero::upgradeSkill($heroUniId,$skillIdx);
|
||||
Hero::upgradeSkill($heroUniId,$skillIdx,$skill['skill_point']);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$propertyChgService->addHeroChg();
|
||||
$this->_rspData(array(
|
||||
|
@ -396,7 +396,7 @@ class Hero extends BaseModel {
|
||||
));
|
||||
}
|
||||
|
||||
public static function upgradeSkill($heroUniId, $skillIdx)
|
||||
public static function upgradeSkill($heroUniId, $skillIdx,$skill_points)
|
||||
{
|
||||
if (!in_array($skillIdx, array(0, 1))) {
|
||||
return;
|
||||
@ -406,6 +406,9 @@ class Hero extends BaseModel {
|
||||
$fieldName => function () use($fieldName) {
|
||||
return "${fieldName} + 1";
|
||||
},
|
||||
'skill_points' => function() use ($skill_points){
|
||||
return "GREATEST(0, skill_points - ${$skill_points})";
|
||||
},
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user