|
|
@ -306,14 +306,13 @@ class Active extends BaseService |
|
|
|
// 获取即将开始的活动 |
|
|
|
// 获取即将开始的活动 |
|
|
|
$data = array_merge($data, $this->getSoonActive($todyActive)); |
|
|
|
$data = array_merge($data, $this->getSoonActive($todyActive)); |
|
|
|
} |
|
|
|
} |
|
|
|
//获取明天活动 |
|
|
|
$tmoActive = $this->ActiveModel->gettmoActive(); |
|
|
|
$tmowActive = $this->ActiveModel->getNowActive(); |
|
|
|
if (!empty($tmoActive)) { |
|
|
|
if (!empty($tmowActive)) { |
|
|
|
|
|
|
|
// 获取即将开始的活动 |
|
|
|
// 获取即将开始的活动 |
|
|
|
$data = array_merge($data, $this->getSoonActive($todyActive)); |
|
|
|
$data = array_merge($data, $this->getmingActive($tmoActive)); |
|
|
|
} |
|
|
|
} |
|
|
|
// 获取预告的活动 |
|
|
|
// 获取预告的活动 |
|
|
|
$data[] = $this->getNoticeActive(); |
|
|
|
// $data[] = $this->getNoticeActive(); |
|
|
|
return array_values(array_filter($data)); |
|
|
|
return array_values(array_filter($data)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -365,7 +364,6 @@ class Active extends BaseService |
|
|
|
foreach ($list as $item) { |
|
|
|
foreach ($list as $item) { |
|
|
|
$startTime = $todyActive['active_date'] + ($item->getData('active_time') * 60 * 60); |
|
|
|
$startTime = $todyActive['active_date'] + ($item->getData('active_time') * 60 * 60); |
|
|
|
$endTime = $startTime + (1 * 60 * 60); |
|
|
|
$endTime = $startTime + (1 * 60 * 60); |
|
|
|
if(strtotime(date('Y-m-d',$startTime))>strtotime(date("y-m-d",time()))){ |
|
|
|
|
|
|
|
$data[] = [ |
|
|
|
$data[] = [ |
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
@ -373,12 +371,32 @@ class Active extends BaseService |
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'status' => ActiveStatusEnum::STATE_NOTICE, |
|
|
|
'status' => ActiveStatusEnum::STATE_SOON, |
|
|
|
'status_text' => '明日预告', |
|
|
|
'status_text' => '即将开抢', |
|
|
|
'status_text2' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'status_text2' => '即将开抢', |
|
|
|
'sharp_modular_text' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'sharp_modular_text' => "{$item['active_time']} 场预告", |
|
|
|
]; |
|
|
|
]; |
|
|
|
}else{ |
|
|
|
} |
|
|
|
|
|
|
|
return $data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取即将开始的活动 |
|
|
|
|
|
|
|
* @param $todyActive |
|
|
|
|
|
|
|
* @return array |
|
|
|
|
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
|
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
|
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private function getmingActive($todyActive): array |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// 当前的时间点 |
|
|
|
|
|
|
|
$list = $this->ActiveTimeModel->getNextActiveTimes($todyActive['active_id']); |
|
|
|
|
|
|
|
if (empty($list) || $list->isEmpty()) return []; |
|
|
|
|
|
|
|
// 整理数据 |
|
|
|
|
|
|
|
$data = []; |
|
|
|
|
|
|
|
foreach ($list as $item) { |
|
|
|
|
|
|
|
$startTime = $todyActive['active_date'] + ($item->getData('active_time') * 60 * 60); |
|
|
|
|
|
|
|
$endTime = $startTime + (1 * 60 * 60); |
|
|
|
$data[] = [ |
|
|
|
$data[] = [ |
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
@ -386,18 +404,14 @@ class Active extends BaseService |
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'status' => ActiveStatusEnum::STATE_SOON, |
|
|
|
'status' => ActiveStatusEnum::STATE_NOTICE, |
|
|
|
'status_text' => '即将开抢', |
|
|
|
'status_text' => '明日预告', |
|
|
|
'status_text2' => '即将开抢', |
|
|
|
'status_text2' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'sharp_modular_text' => "{$item['active_time']} 场预告", |
|
|
|
'sharp_modular_text' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取预告的活动 |
|
|
|
* 获取预告的活动 |
|
|
|
* @return array |
|
|
|
* @return array |
|
|
@ -424,7 +438,7 @@ class Active extends BaseService |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
'status' => ActiveStatusEnum::STATE_NOTICE, |
|
|
|
'status' => ActiveStatusEnum::STATE_NOTICE, |
|
|
|
'status_text' => '明日预告', |
|
|
|
'status_text' => '预告', |
|
|
|
'status_text2' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'status_text2' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'sharp_modular_text' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
'sharp_modular_text' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
]; |
|
|
|
]; |
|
|
|