Parcourir la source

调整场次获取按照热映影片方式获取

family il y a 1 an
Parent
commit
81c0bfa946

+ 6 - 7
app/command/CinemaSchedCommand.php

@@ -2,6 +2,7 @@
2 2
 
3 3
 namespace app\command;
4 4
 
5
+use app\common\model\user\User;
5 6
 use app\common\repositories\movie\CinemaRepository;
6 7
 use app\common\repositories\movie\CinemaSchedRepository;
7 8
 use app\common\repositories\movie\FilmRepository;
@@ -34,11 +35,9 @@ class CinemaSchedCommand extends Command
34 35
             $filmRepository = app()->make(FilmRepository::class);
35 36
             $filmResult = $filmRepository->getFilm($this->page, $this->limit);
36 37
 
37
-            foreach ($result['cinema_list'] as $key => $value) {
38
-                foreach ($filmResult['film_list'] as $subKey => $subValue) {
39
-                    $this->doCinemaSched($subValue, $value);
40
-//                    if ($subValue['film_sign'] == 'F6556061D4' && $value['cinema_sign'] == 'CCB622D8D8') {
41
-//                    }
38
+            foreach ($filmResult['film_list'] as $key => $film) {
39
+                foreach ($result['cinema_list'] as $subKey => $cinema) {
40
+                    $this->doCinemaSched($film, $cinema);
42 41
                 }
43 42
             }
44 43
         } catch (\Exception $exception) {
@@ -89,8 +88,8 @@ class CinemaSchedCommand extends Command
89 88
                     'hall_sign' => $value['hall_sign'],
90 89
                     'hall_name' => $value['hall_name'],
91 90
                     'stop_sell_time' => strtotime($value['stop_sell_time']),
92
-                    'price' => $value['price'], // 
93
-                    'cost_price' => $value['cost_price'], // 销售
91
+                    'price' => $value['price'], // 销售
92
+                    'cost_price' => $value['cost_price'], // 
94 93
                     'channel_price' => json_encode($value['channel_price'], JSON_FORCE_OBJECT)
95 94
                 ];
96 95
                 $where = [

+ 2 - 2
app/common/repositories/movie/MovieRepository.php

@@ -101,7 +101,7 @@ class MovieRepository extends BaseRepository
101 101
             foreach ($fileSchedValue as $key => $value) {
102 102
                 $pcYanglaojinGongxian = static::getPvYanglaojinScore($value['cost_price']);
103 103
 
104
-                $fileSchedValue[$key]['price'] = $pcYanglaojinGongxian['cost_price'];
104
+                $fileSchedValue[$key]['price'] = $pcYanglaojinGongxian['cost_price']; // 销售价
105 105
                 $fileSchedValue[$key]['yanglaojin'] = $pcYanglaojinGongxian['yanglaojin'];
106 106
                 $fileSchedValue[$key]['pv'] = $pcYanglaojinGongxian['pv'];
107 107
                 $fileSchedValue[$key]['score'] = $pcYanglaojinGongxian['score'];
@@ -169,7 +169,7 @@ class MovieRepository extends BaseRepository
169 169
         if (empty($sched)) throw new ValidateException('观影场次不存在');
170 170
 
171 171
         $seat_sign = json_decode($params['seat_sign'], true);
172
-        $order_price = round($sched['price'] * count($seat_sign), 2);
172
+        $order_price = bcmul((string)$sched['cost_price'], (string)count($seat_sign), 2);
173 173
         $submitOrder = DouHuoMallFilmApiRequest::submitOrder($userinfo->phone, $params['channel_type'], $params['sched_sign'], $seat_sign, $order_sn, $order_price);
174 174
         if (!empty($submitOrder) && isset($submitOrder['code']) && ($submitOrder['code'] == ApiResponseService::DEFAULT_SUCCESS_CODE) && isset($submitOrder['data']['plat_order'])) {
175 175
             /** @var CinemaRepository $cinemaRepository */