This commit is contained in:
hujiabin 2022-08-31 20:14:12 +08:00
parent 8468ed2655
commit ae0c533ddf
3 changed files with 15 additions and 11 deletions

View File

@ -28,8 +28,10 @@ class ChipController extends BaseAuthedController
$chipList = Chip::all($type);
$chipDtoList = array();
foreach ($chipList as $item) {
// array_push($chipDtoList, $item);
array_push($chipDtoList, Chip::toDto($item));
}
// print_r($chipDtoList);die;
$this->_rspData(array(
'data' => $chipDtoList,
));

View File

@ -39,7 +39,7 @@ class UserController extends BaseAuthedController {
if (!$userInfo) {
$this->createNewUser($userName, $avatarUrl);
//$this->addChip();
$this->addChip();
$userInfo = $this->_getOrmUserInfo();
}

View File

@ -72,6 +72,7 @@ class Chip extends BaseModel
$attr_pool = emptyReplace(json_decode($row['rand_attr'], true), array());
$attrs = array();
foreach ($attr_pool as $key=>$val){
if ($val){
$attr = mt\ChipAttr::getAttrById($val['attr_id'],$val['attr_type']);
$newAttr = [
@ -85,6 +86,7 @@ class Chip extends BaseModel
];
array_push($attrs,$newAttr);
}
}
$row['rand_attr'] = $attrs;
$row['today_get_gold'] = $todayGetGold;
$row['last_get_gold_time'] = $lastGetGoldTime;