Merge branch 'james_bc' into hjb
This commit is contained in:
commit
02e4111a1b
@ -23,6 +23,7 @@ require_once('services/AwardService.php');
|
||||
require_once('services/PropertyChgService.php');
|
||||
require_once('services/SeasonService.php');
|
||||
require_once('services/NameService.php');
|
||||
require_once('services/ChipPageService.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\User;
|
||||
@ -52,6 +53,9 @@ class UserController extends BaseAuthedController {
|
||||
$this->_addFreeItem(); //送 50 Test_CEG
|
||||
$userInfo = $this->_getOrmUserInfo();
|
||||
$this->_setV(TN_RANK_STATUS, 0, 1);
|
||||
//初始化芯片页
|
||||
$chipPageObj = new services\ChipPageService();
|
||||
$chipPageObj->init();
|
||||
}
|
||||
//elo score 衰减
|
||||
$this->dampingElo($userInfo);
|
||||
|
@ -11,6 +11,14 @@ class ChipPageService extends BaseService
|
||||
const MAX_CHIP_SLOT_NUM = 30;
|
||||
const INIT_CHIP_PAGE_NUM = 3;
|
||||
|
||||
public function init(){
|
||||
$count = ChipPage::getCount();
|
||||
if (!$count){
|
||||
for ($i=0;$i<self::INIT_CHIP_PAGE_NUM;$i++){
|
||||
ChipPage::addChipPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function initChipPage(){
|
||||
$rows = SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
@ -19,11 +27,11 @@ class ChipPageService extends BaseService
|
||||
'account_id'=> myself()->_getAccountId()
|
||||
)
|
||||
);
|
||||
if (!$rows){
|
||||
for ($i=0;$i<self::INIT_CHIP_PAGE_NUM;$i++){
|
||||
ChipPage::addChipPage();
|
||||
}
|
||||
}
|
||||
// if (!$rows){
|
||||
// for ($i=0;$i<self::INIT_CHIP_PAGE_NUM;$i++){
|
||||
// ChipPage::addChipPage();
|
||||
// }
|
||||
// }
|
||||
if ($rows){
|
||||
foreach ($rows as $row){
|
||||
$this->refreshSlotState($row);
|
||||
@ -31,7 +39,7 @@ class ChipPageService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
private function refreshSlotState($row){
|
||||
public function refreshSlotState($row){
|
||||
$data = emptyReplace(json_decode($row['data'], true), array());
|
||||
$userInfo = myself()->_getOrmUserInfo();
|
||||
foreach ($data as &$val){
|
||||
|
Loading…
x
Reference in New Issue
Block a user