1
This commit is contained in:
parent
8468ed2655
commit
ae0c533ddf
@ -28,8 +28,10 @@ class ChipController extends BaseAuthedController
|
|||||||
$chipList = Chip::all($type);
|
$chipList = Chip::all($type);
|
||||||
$chipDtoList = array();
|
$chipDtoList = array();
|
||||||
foreach ($chipList as $item) {
|
foreach ($chipList as $item) {
|
||||||
|
// array_push($chipDtoList, $item);
|
||||||
array_push($chipDtoList, Chip::toDto($item));
|
array_push($chipDtoList, Chip::toDto($item));
|
||||||
}
|
}
|
||||||
|
// print_r($chipDtoList);die;
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'data' => $chipDtoList,
|
'data' => $chipDtoList,
|
||||||
));
|
));
|
||||||
|
@ -39,7 +39,7 @@ class UserController extends BaseAuthedController {
|
|||||||
if (!$userInfo) {
|
if (!$userInfo) {
|
||||||
$this->createNewUser($userName, $avatarUrl);
|
$this->createNewUser($userName, $avatarUrl);
|
||||||
|
|
||||||
//$this->addChip();
|
$this->addChip();
|
||||||
|
|
||||||
$userInfo = $this->_getOrmUserInfo();
|
$userInfo = $this->_getOrmUserInfo();
|
||||||
}
|
}
|
||||||
|
@ -72,18 +72,20 @@ class Chip extends BaseModel
|
|||||||
$attr_pool = emptyReplace(json_decode($row['rand_attr'], true), array());
|
$attr_pool = emptyReplace(json_decode($row['rand_attr'], true), array());
|
||||||
$attrs = array();
|
$attrs = array();
|
||||||
foreach ($attr_pool as $key=>$val){
|
foreach ($attr_pool as $key=>$val){
|
||||||
$attr = mt\ChipAttr::getAttrById($val['attr_id'],$val['attr_type']);
|
if ($val){
|
||||||
$newAttr = [
|
$attr = mt\ChipAttr::getAttrById($val['attr_id'],$val['attr_type']);
|
||||||
|
$newAttr = [
|
||||||
|
|
||||||
'attr_id' => $attr['attr_id'],
|
'attr_id' => $attr['attr_id'],
|
||||||
'type' => 2,
|
'type' => 2,
|
||||||
'val' => $attr['lv'.$row['chip_grade']]*$val['attr_pool_number'],
|
'val' => $attr['lv'.$row['chip_grade']]*$val['attr_pool_number'],
|
||||||
// 'chip_name' => $attr['chip_name'],
|
// 'chip_name' => $attr['chip_name'],
|
||||||
'chip_type' => $attr['chip_type'],
|
'chip_type' => $attr['chip_type'],
|
||||||
'attr_num' => $attr['lv'.$row['chip_grade']],
|
'attr_num' => $attr['lv'.$row['chip_grade']],
|
||||||
'attr_pool_num' => $val['attr_pool_number'],
|
'attr_pool_num' => $val['attr_pool_number'],
|
||||||
];
|
];
|
||||||
array_push($attrs,$newAttr);
|
array_push($attrs,$newAttr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$row['rand_attr'] = $attrs;
|
$row['rand_attr'] = $attrs;
|
||||||
$row['today_get_gold'] = $todayGetGold;
|
$row['today_get_gold'] = $todayGetGold;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user