소스 검색

修改参数

family 1 년 전
부모
커밋
fe9f3b8559
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 1
      app/common/model/movie/cinema/CinemaSched.php
  2. 3 3
      app/common/repositories/movie/CinemaSchedRepository.php

+ 5 - 1
app/common/model/movie/cinema/CinemaSched.php

@@ -27,11 +27,15 @@ class CinemaSched extends BaseModel
27 27
         })->when(isset($where['cinema_sign']) && $where['cinema_sign'], function ($query) use ($where) {
28 28
             $query->where('cinema_sign', $where['cinema_sign']);
29 29
         })->when(isset($where['show_date']) && $where['show_date'], function ($query) use ($where) {
30
-            $query->where('show_date', '>=', $where['show_date']);
30
+            $query->where('show_date', $where['show_date']);
31
+        })->when(isset($where['date']) && $where['date'], function ($query) use ($where) {
32
+            $query->where('show_date', '>=', $where['date']);
31 33
         })->when(isset($where['relation_id']) && $where['relation_id'], function ($query) use ($where) {
32 34
             $query->where('relation_id', $where['relation_id']);
33 35
         })->when(isset($where['sched_sign']) && $where['sched_sign'], function ($query) use ($where) {
34 36
             $query->where('sched_sign', $where['sched_sign']);
37
+        })->when(isset($where['show_time']) && $where['show_time'], function ($query) use ($where) {
38
+            $query->where('show_time', '>=', $where['show_time']);
35 39
         });
36 40
     }
37 41
 }

+ 3 - 3
app/common/repositories/movie/CinemaSchedRepository.php

@@ -40,7 +40,7 @@ class CinemaSchedRepository extends BaseRepository
40 40
     public function getFilmSchedDate($film_sign)
41 41
     {
42 42
         $field = 'show_date';
43
-        $where = ['film_sign' => $film_sign, 'show_date' => strtotime(date('Y-m-d'))];
43
+        $where = ['film_sign' => $film_sign, 'date' => strtotime(date('Y-m-d'))];
44 44
 
45 45
         $show_date = $this->dao->search(null, $where)->field([$field])->order('show_date asc')->group('show_date')->select()->toArray();
46 46
         foreach ($show_date as $key => $value) {
@@ -63,10 +63,10 @@ class CinemaSchedRepository extends BaseRepository
63 63
      * @throws \think\db\exception\DbException
64 64
      * @throws \think\db\exception\ModelNotFoundException
65 65
      */
66
-    public function getFilmSched($page, $limit, $film_sign, $longitude, $latitude, $show_date, $with = [], $order = 1)
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];
69
+        $where = ['film_sign' => $film_sign, 'show_date' => $show_date, 'show_time' => $show_time];
70 70
 
71 71
         $cinema_sched = $this->dao->search(null, $where)->when($with, function ($query) use ($with) {
72 72
             $query->with($with);