1
This commit is contained in:
parent
6f3dc858e9
commit
5f39be92af
@ -51,6 +51,18 @@ class HashRate(object):
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},{
|
||||
'name': 'redTips',
|
||||
'desc': '红点提示',
|
||||
'group': 'HashRate',
|
||||
'url': 'webapp/index.php?c=HashRate&a=redTips',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['!tips', [], '任务类型'],
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -169,6 +169,26 @@ class HashRateController extends BaseAuthedController
|
||||
$this->_rspOk();
|
||||
}
|
||||
|
||||
public function redTips(){
|
||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||
if (!$currentPeriod){
|
||||
$this->_rspErr(1, 'Already ended');
|
||||
return;
|
||||
}
|
||||
$tips = array();
|
||||
for ($i=1;$i<5;$i++){
|
||||
foreach ($this->hashRateService->hashRateTask['task'.$i] as $task){
|
||||
$taskDb = HashRate::find($task['task_id'],$currentPeriod['id']);
|
||||
$taskDto = $this->hashRateService->hashRateTaskDto($task,$taskDb,$currentPeriod['id']);
|
||||
if ($taskDto['state'] == \services\HashRateService::FINISHED_STATE){
|
||||
array_push($tips,$i);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_rspData(array(
|
||||
'tips' => $tips,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user