1
This commit is contained in:
parent
28bb7d9e25
commit
4fde638257
@ -59,6 +59,11 @@ class BaseController {
|
||||
return phpcommon\getDaySeconds($time, $this->timeZone);
|
||||
}
|
||||
|
||||
public function _getDaySecondsOffset($time)
|
||||
{
|
||||
return $time - phpcommon\getDaySeconds($time, $this->timeZone);
|
||||
}
|
||||
|
||||
public function _getTodayRemainSeconds()
|
||||
{
|
||||
return max(0, $this->_getNowDaySeconds() + 3600 * 24 - $this->_getNowTime());
|
||||
|
@ -314,12 +314,20 @@ class OtherController extends BaseAuthedController {
|
||||
if ($modeMeta['limit_time'] == 2 && (empty($taskStatus) || !$taskMeta || myself()->_getNowTime() <= strtotime($taskMeta['income_start_time']))){
|
||||
return true;
|
||||
}
|
||||
|
||||
$temp = array(
|
||||
'id' => $modeMeta['id']
|
||||
);
|
||||
if ($modeMeta['id'] == 1){
|
||||
$dailyOpenTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ".$modeMeta['daily_open_time']));
|
||||
$dailyEndTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ".$modeMeta['daily_end_time']));
|
||||
$nowTimeOffset = myself()->_getDaySecondsOffset(myself()->_getNowTime());
|
||||
$temp['daily_open_time'] = strtotime($modeMeta['daily_open_time']) ;
|
||||
$temp['daily_end_time'] = strtotime($modeMeta['daily_end_time']);
|
||||
$temp['state'] = $nowTimeOffset >= $dailyOpenTimeOffset && $nowTimeOffset <= $dailyEndTimeOffset ? 1 : 0;
|
||||
}
|
||||
array_push(
|
||||
$modeList,
|
||||
array(
|
||||
'id' => $modeMeta['id']
|
||||
)
|
||||
$temp
|
||||
);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user