|
|
@ -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,39 +364,54 @@ 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'], |
|
|
|
'active_time' => $item['active_time'], |
|
|
|
'active_time' => $item['active_time'], |
|
|
|
'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) . ' 开始', |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return $data; |
|
|
|
$data[] = [ |
|
|
|
} |
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
/** |
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
|
* 获取即将开始的活动 |
|
|
|
'active_time' => $item['active_time'], |
|
|
|
* @param $todyActive |
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
* @return array |
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
'status' => ActiveStatusEnum::STATE_SOON, |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
'status_text' => '即将开抢', |
|
|
|
*/ |
|
|
|
'status_text2' => '即将开抢', |
|
|
|
private function getmingActive($todyActive): array |
|
|
|
'sharp_modular_text' => "{$item['active_time']} 场预告", |
|
|
|
{ |
|
|
|
]; |
|
|
|
// 当前的时间点 |
|
|
|
} |
|
|
|
$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[] = [ |
|
|
|
|
|
|
|
'active_id' => $todyActive['active_id'], |
|
|
|
|
|
|
|
'active_time_id' => $item['active_time_id'], |
|
|
|
|
|
|
|
'active_time' => $item['active_time'], |
|
|
|
|
|
|
|
'start_time' => $this->onFormatTime($startTime), |
|
|
|
|
|
|
|
'end_time' => $this->onFormatTime($endTime), |
|
|
|
|
|
|
|
'count_down_time' => $this->onFormatTime($startTime), |
|
|
|
|
|
|
|
'status' => ActiveStatusEnum::STATE_NOTICE, |
|
|
|
|
|
|
|
'status_text' => '明日预告', |
|
|
|
|
|
|
|
'status_text2' => $this->onFormatTime($startTime) . ' 开始', |
|
|
|
|
|
|
|
'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) . ' 开始', |
|
|
|
]; |
|
|
|
]; |
|
|
|