This commit is contained in:
hujiabin 2022-10-28 16:02:19 +08:00
parent 85cc5bfb32
commit dc5bb7cb77
2 changed files with 13 additions and 11 deletions

View File

@ -58,9 +58,9 @@ class UserController extends BaseAuthedController {
//测试服
if (!$userInfo) {
$this->createNewUserV2($userName);
$this->addChip(); //测试需要,上线要删除
$this->addFragmentBox(); //测试需要,上线要删除
$this->_addFreeItem(); //测试需要,上线要删除
$this->addFragmentBox(); //测试需要,上线要删除
$this->addChip(); //测试需要,上线要删除
$userInfo = $this->_getOrmUserInfo();
$this->_setV(TN_RANK_STATUS, 0, 1);
}

View File

@ -108,15 +108,17 @@ class ChipAttr {
private static function _randomNum($itemMeta,$chip_grade,$chipList){
$attr_pool = array();
array_push($attr_pool,self::getAttrPool(self::getAttrByItemId($itemMeta['id'])));
if ($chip_grade>=3&&$chip_grade<5){
$num = 1;
}
if ($chip_grade>=5){
$num = 2;
}
for ($i=1;$i<=$num;$i++){
$attr = $chipList[ array_rand($chipList)];
array_push($attr_pool,self::getAttrPool($attr));
if ($chip_grade>=3){
if ($chip_grade<5){
$num = 1;
}
if ($chip_grade>=5){
$num = 2;
}
for ($i=1;$i<=$num;$i++){
$attr = $chipList[ array_rand($chipList)];
array_push($attr_pool,self::getAttrPool($attr));
}
}
return $attr_pool ;
}