|
|
@@ -66,7 +66,8 @@ class CinemaSchedRepository extends BaseRepository
|
|
66
|
66
|
public function getFilmSched($page, $limit, $film_sign, $longitude, $latitude, $show_date, $show_time, $with = [], $order = 1)
|
|
67
|
67
|
{
|
|
68
|
68
|
$field = 'sched_sign,cinema_sign,cinema_name,address,show_date,price,longitude,latitude';
|
|
69
|
|
- $where = ['film_sign' => $film_sign, 'show_date' => $show_date, 'show_time' => $show_time];
|
|
|
69
|
+ $where = ['film_sign' => $film_sign, 'show_date' => $show_date];
|
|
|
70
|
+ if ($show_date == strtotime(date('Y-m-d'))) $where['show_time'] = $show_time;
|
|
70
|
71
|
|
|
71
|
72
|
$cinema_sched = $this->dao->search(null, $where)->when($with, function ($query) use ($with) {
|
|
72
|
73
|
$query->with($with);
|
|
|
@@ -78,7 +79,7 @@ class CinemaSchedRepository extends BaseRepository
|
|
78
|
79
|
if ($order == 1) {//距离最近
|
|
79
|
80
|
$query->order('distance asc');
|
|
80
|
81
|
} else {//播放日期
|
|
81
|
|
- $query->order('show_date desc');
|
|
|
82
|
+ $query->order('show_time asc');
|
|
82
|
83
|
}
|
|
83
|
84
|
})->field([$field])->group('cinema_sign')->select()->toArray();
|
|
84
|
85
|
foreach ($cinema_sched as $key => $value) {
|