_getSelfMysql(), 't_chip_page', array( 'account_id'=> myself()->_getAccountId() ) ); if ($rows){ foreach ($rows as $row){ $this->refreshSlotState($row); } } } public function refreshSlotState($row){ $data = emptyReplace(json_decode($row['data'], true), array()); $userInfo = myself()->_getOrmUserInfo(); $maxSlot = \mt\StarLevel::getMaxSlot($userInfo['star_num']); foreach ($data as &$val){ if ($maxSlot < $val['slot_id'] && $val['state'] == 0){ $val['state'] = 0; }else{ $val['state'] = 1; } } SqlHelper::update( myself()->_getSelfMysql(), 't_chip_page', array( 'idx' => $row['idx'] ), array( 'data' => json_encode($data), ) ); } }