Przeglądaj źródła

Merge branch 'master' of https://git.bjtdba.com/shop/php

xialei 1 rok temu
rodzic
commit
9b84ecf619

+ 16 - 12
app/common/repositories/movie/MovieRepository.php

@@ -176,9 +176,9 @@ class MovieRepository extends BaseRepository
176 176
         $order_sn = substr($storeOrder->getNewOrderId(), 0, 20);
177 177
 
178 178
         /** @var CinemaSchedRepository $cinemaSchedRepository */
179
-        $cinemaSchedRepository = app()->make(CinemaSchedRepository::class);
180
-        $sched = $cinemaSchedRepository->getCinemaSchedInfo($params['relation_id'], $params['sched_sign']);
181
-        if (empty($sched)) throw new ValidateException('观影场次不存在');
179
+//        $cinemaSchedRepository = app()->make(CinemaSchedRepository::class);
180
+//        $sched = $cinemaSchedRepository->getCinemaSchedInfo($params['relation_id'], $params['sched_sign']);
181
+//        if (empty($sched)) throw new ValidateException('观影场次不存在');
182 182
 
183 183
         $channel_sn = json_decode(base64_decode($params['channel_sn']), true);
184 184
         if (empty($channel_sn) || !isset($channel_sn['channel_type']) || empty($channel_sn['channel_type']) || !isset($channel_sn['price'])
@@ -194,7 +194,11 @@ class MovieRepository extends BaseRepository
194 194
         if (!empty($submitOrder) && isset($submitOrder['code']) && ($submitOrder['code'] == ApiResponseService::DEFAULT_SUCCESS_CODE) && isset($submitOrder['data']['plat_order'])) {
195 195
             /** @var CinemaRepository $cinemaRepository */
196 196
             $cinemaRepository = app()->make(CinemaRepository::class);
197
-            $cinema = $cinemaRepository->getCinemaInfo($sched['cinema_sign']);
197
+            $cinema = $cinemaRepository->getCinemaInfo($params['cinema_sign']);
198
+
199
+            /** @var FilmRepository $filmRepository */
200
+            $filmRepository = app()->make(FilmRepository::class);
201
+            $filminfo = $filmRepository->getFilmInfo($params['film_sign']);
198 202
 
199 203
             $_order = [
200 204
                 'uid' => $userinfo->uid,
@@ -214,14 +218,14 @@ class MovieRepository extends BaseRepository
214 218
                 'address' => $cinema['address'],
215 219
                 'longitude' => $cinema['longitude'],
216 220
                 'latitude' => $cinema['latitude'],
217
-                'hall_sign' => $sched['hall_sign'],
218
-                'hall_name' => $sched['hall_name'],
219
-                'relation_id' => $sched['relation_id'],
220
-                'sched_sign' => $sched['sched_sign'],
221
-                'film_sign' => $sched['film_sign'],
222
-                'film_name' => $sched['film_name'],
223
-                'show_date' => $sched['show_date'],
224
-                'show_time' => $sched['show_time'],
221
+                'hall_sign' => $params['hall_sign'],
222
+                'hall_name' => $params['hall_name'],
223
+                'relation_id' => $params['relation_id'],
224
+                'sched_sign' => $params['sched_sign'],
225
+                'film_sign' => $filminfo['film_sign'],
226
+                'film_name' => $filminfo['film_name'],
227
+                'show_date' => $params['show_date'],
228
+                'show_time' => $params['show_time'],
225 229
                 'sched_seat' => $params['sched_seat'], // 场次座位
226 230
                 'create_time' => time()
227 231
             ];

+ 10 - 1
app/controller/api/movie/Movie.php

@@ -186,10 +186,19 @@ class Movie extends BaseController
186 186
     {
187 187
         $params['relation_id'] = $this->request->param('relation_id', '');// 场次ID
188 188
         $params['sched_sign'] = $this->request->param('sched_sign', '');// 场次编码
189
-        $params['sched_seat'] = $this->request->param('sched_seat', '');// 座位编码
190 189
         $params['channel_sn'] = $this->request->param('channel_sn', '');// 实际价格
190
+        $params['sched_seat'] = $this->request->param('sched_seat', '');// 座位编码
191
+        $params['hall_sign'] = $this->request->param('hall_sign', '');// 影厅编码
192
+        $params['hall_name'] = $this->request->param('hall_name', '');// 影厅名称
193
+        $params['show_date'] = $this->request->param('show_date', '');// 观影日期
194
+        $params['show_time'] = $this->request->param('show_time', '');// 观影时间
195
+        $params['film_sign'] = $this->request->param('film_sign', '');// 影片编码
196
+        $params['cinema_sign'] = $this->request->param('cinema_sign', '');// 影院编码
191 197
         $params['phone'] = $this->request->param('phone', '');// 联系电话
192 198
 
199
+        if (empty($params['cinema_sign']) || empty($params['hall_sign']) || empty($params['hall_name'])) return app('json')->fail('请选择观影影院');
200
+        if (empty($params['film_sign'])) return app('json')->fail('请选择观影影片');
201
+        if (empty($params['show_date']) || empty($params['show_time'])) return app('json')->fail('请选择观影时间');
193 202
         if (empty($params['relation_id']) || empty($params['sched_sign']) || empty($params['channel_sn'])) return app('json')->fail('请选择观影场次');
194 203
         if (empty($params['sched_seat'])) return app('json')->fail('请选择观影座位');
195 204