|
|
|
|
@ -40,7 +40,7 @@ class H5ContentController extends Controller
|
|
|
|
|
$q->whereComputedScheduleStatus($st);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
->orderByHotThenScheduleStatusPriority()
|
|
|
|
|
->orderByHotThenH5ActivityListRecentEnded()
|
|
|
|
|
->paginate($size);
|
|
|
|
|
|
|
|
|
|
$rows->getCollection()->transform(function ($a) {
|
|
|
|
|
@ -421,7 +421,7 @@ class H5ContentController extends Controller
|
|
|
|
|
$payload['activities'] = Activity::query()
|
|
|
|
|
->where('venue_id', $v->id)
|
|
|
|
|
->visibleOnH5()
|
|
|
|
|
->orderByHotThenScheduleStatusPriority()
|
|
|
|
|
->orderByHotThenH5ActivityListRecentEnded()
|
|
|
|
|
->with('activityDays')
|
|
|
|
|
->with('venue:id,cover_image')
|
|
|
|
|
->limit(50)
|
|
|
|
|
@ -788,17 +788,33 @@ class H5ContentController extends Controller
|
|
|
|
|
if ($sx !== $sy) {
|
|
|
|
|
return $sx <=> $sy;
|
|
|
|
|
}
|
|
|
|
|
$aStart = $x['start_at'] ?? '';
|
|
|
|
|
$bStart = $y['start_at'] ?? '';
|
|
|
|
|
if ($aStart !== $bStart) {
|
|
|
|
|
if ($aStart === '' || $aStart === null) {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ($bStart === '' || $bStart === null) {
|
|
|
|
|
return -1;
|
|
|
|
|
/** 已结束:按结束日期由近到远(字符串比较兼容 ISO8601 / YYYY-MM-DD) */
|
|
|
|
|
if ($sx === 2) {
|
|
|
|
|
$ae = (string) ($x['end_at'] ?? '');
|
|
|
|
|
$be = (string) ($y['end_at'] ?? '');
|
|
|
|
|
if ($ae !== $be) {
|
|
|
|
|
if ($ae === '') {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ($be === '') {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $be <=> $ae;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$aStart = $x['start_at'] ?? '';
|
|
|
|
|
$bStart = $y['start_at'] ?? '';
|
|
|
|
|
if ($aStart !== $bStart) {
|
|
|
|
|
if ($aStart === '' || $aStart === null) {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if ($bStart === '' || $bStart === null) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $aStart <=> $bStart;
|
|
|
|
|
return $aStart <=> $bStart;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tx = $this->mixedListActivityTicketPaidRank($x);
|
|
|
|
|
|