1
This commit is contained in:
parent
6b0187869b
commit
8f22573e97
@ -221,10 +221,30 @@ class Hero extends BaseModel {
|
|||||||
public static function toDto($row)
|
public static function toDto($row)
|
||||||
{
|
{
|
||||||
$attr = emptyReplace(json_decode($row['rand_attr'], true), array());
|
$attr = emptyReplace(json_decode($row['rand_attr'], true), array());
|
||||||
// if (!$attr){
|
if (!$attr){
|
||||||
// $heroMeta = mt\Hero::get($row['hero_id']);
|
$heroMeta = mt\Hero::get($row['hero_id']);
|
||||||
// $attr = mt\Hero::getHeroAttr($heroMeta);
|
$baseAttr = mt\Hero::getHeroAttr($heroMeta);
|
||||||
// }
|
foreach ($baseAttr as $value){
|
||||||
|
if (in_array($value['attr_id'],array(kHAT_Hp,kHAT_Atk,kHAT_Def))){
|
||||||
|
array_push($attr,array(
|
||||||
|
'attr_id' => $value['attr_id'],
|
||||||
|
'val' => $value['val'] ,
|
||||||
|
'quality' => rand(2,3),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
array_push($attr,array(
|
||||||
|
'attr_id' => $value['attr_id'],
|
||||||
|
'val' => $value['val'] ,
|
||||||
|
'quality' => 0,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self::update($row['idx'],array(
|
||||||
|
'rand_attr'=>json_encode($attr)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
// $lockType = 0;
|
// $lockType = 0;
|
||||||
// $unlockTime = 0;
|
// $unlockTime = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user