hashRateService = new services\HashRateService(); $this->hashRateService->init(); } public function info(){ $mateList = \mt\AchievementsPower::getMetaList(); $currentPeriod= \mt\AchievementsCycle::getCurrentPeriod(); $info = array( 'list' => array(), 'obtain_start_time' => 0, 'obtain_end_time' => 0, 'income_start_time' => 0, 'income_end_time' => 0, 'state' => 0, 'myHashRate' => 0, ); if ($currentPeriod){ foreach ($mateList as $mate) { $temp = $this->hashRateService->hashRateTaskDto($mate ,$currentPeriod); array_push($info['list'], $temp); } $obtain_start_time = strtotime($currentPeriod['obtain_start_time']); $obtain_end_time = strtotime($currentPeriod['obtain_end_time']); $income_start_time = strtotime($currentPeriod['income_start_time']); $income_end_time = strtotime($currentPeriod['income_end_time']); $info['obtain_start_time'] = $obtain_start_time; $info['obtain_end_time'] = $obtain_end_time; $info['income_start_time'] = $income_start_time; $info['income_end_time'] = $income_end_time; if(myself()->_getNowTime() >= $obtain_start_time && myself()->_getNowTime() <= $obtain_end_time){ $info['state'] = 1; }elseif (myself()->_getNowTime() >= $income_start_time && myself()->_getNowTime() <= $income_end_time){ $info['state'] = 2; } $info['myHashRate'] = HashRate::getMyHashRate( $currentPeriod['id']); } $this->_rspData($info); } }