|
|
@@ -100,6 +100,58 @@ class CinemaSchedRepository extends BaseRepository
|
|
100
|
100
|
}
|
|
101
|
101
|
|
|
102
|
102
|
/**
|
|
|
103
|
+ * 获取影片场次列表
|
|
|
104
|
+ *
|
|
|
105
|
+ * @param $cinema_sign
|
|
|
106
|
+ * @param $film_sign
|
|
|
107
|
+ * @param $show_date
|
|
|
108
|
+ * @param $show_time
|
|
|
109
|
+ * @return array
|
|
|
110
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
111
|
+ * @throws \think\db\exception\DbException
|
|
|
112
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
113
|
+ */
|
|
|
114
|
+ public function getCinemaFilmSchedNew($film_sign, $cinema_sign)
|
|
|
115
|
+ {
|
|
|
116
|
+ /** @var FilmRepository $filmRepository */
|
|
|
117
|
+ $filmRepository = app()->make(FilmRepository::class);
|
|
|
118
|
+ $filminfo = $filmRepository->getFilmInfo($film_sign);
|
|
|
119
|
+ if (empty($filminfo)) throw new \Exception('影片不存在');
|
|
|
120
|
+
|
|
|
121
|
+ /** @var CinemaRepository $cinemaRepository */
|
|
|
122
|
+ $cinemaRepository = app()->make(CinemaRepository::class);
|
|
|
123
|
+ $cinemainfo = $cinemaRepository->getCinemaInfo($cinema_sign);
|
|
|
124
|
+
|
|
|
125
|
+ // 获取排片场次
|
|
|
126
|
+ /** @var MovieRepository $movieRepository */
|
|
|
127
|
+ $movieRepository = app()->make(MovieRepository::class);
|
|
|
128
|
+ $cinema_sched = $movieRepository->getCinemaSched($film_sign, $cinema_sign);
|
|
|
129
|
+
|
|
|
130
|
+ // 排片日期
|
|
|
131
|
+ $show_date = array_keys($cinema_sched);
|
|
|
132
|
+ // 场次列表
|
|
|
133
|
+ foreach ($cinema_sched as $date => &$cinema_schedValue) {
|
|
|
134
|
+ foreach ($cinema_schedValue as $key => $value) {
|
|
|
135
|
+ $cinema_schedValue[$key]['cinema_sign'] = $cinemainfo->cinema_sign;
|
|
|
136
|
+ $cinema_schedValue[$key]['cinema_name'] = $cinemainfo->cinema_name;
|
|
|
137
|
+ $cinema_schedValue[$key]['end_time'] = date('H:i', (strtotime($value['show_time']) + $filminfo['duration'] * 60));
|
|
|
138
|
+ $cinema_schedValue[$key]['film'] = [
|
|
|
139
|
+ 'film_sign' => $filminfo->film_sign,
|
|
|
140
|
+ 'publish_date' => date('Y-m-d', $filminfo->publish_date),
|
|
|
141
|
+ 'language' => $filminfo->language,
|
|
|
142
|
+ 'type' => $filminfo->type,
|
|
|
143
|
+ 'duration' => $filminfo->duration,
|
|
|
144
|
+ 'version' => $filminfo->version
|
|
|
145
|
+ ];
|
|
|
146
|
+ unset($cinema_schedValue[$key]['channel_price']);
|
|
|
147
|
+ unset($cinema_schedValue[$key]['cost_price']);
|
|
|
148
|
+ }
|
|
|
149
|
+ }
|
|
|
150
|
+
|
|
|
151
|
+ return compact('show_date', 'cinema_sched');
|
|
|
152
|
+ }
|
|
|
153
|
+
|
|
|
154
|
+ /**
|
|
103
|
155
|
* @param $page
|
|
104
|
156
|
* @param $limit
|
|
105
|
157
|
* @param $cinema_sign
|