_getSelfMysql(), 't_chip_page', array( 'account_id'=> myself()->_getAccountId() ) ); // if (!$rows){ // for ($i=0;$irefreshSlotState($row); } } } public function refreshSlotState($row){ $data = emptyReplace(json_decode($row['data'], true), array()); $userInfo = myself()->_getOrmUserInfo(); $starMeta = \mt\StarLevel::getCurrent($userInfo['star_num']); if ($starMeta['unlock_chip_slot']){ foreach ($data as &$val){ if ($starMeta['unlock_chip_slot'] < $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), ) ); } // foreach ($data as &$val){ // if ($userInfo['level'] < $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), // ) // ); } }