Procházet zdrojové kódy

调整场次结构数据

family před 1 rokem
rodič
revize
c210efd44f

+ 2 - 0
app/command/CinemaSchedCommand.php

@@ -37,6 +37,8 @@ class CinemaSchedCommand extends Command
37 37
             foreach ($result['cinema_list'] as $key => $value) {
38 38
                 foreach ($filmResult['film_list'] as $subKey => $subValue) {
39 39
                     $this->doCinemaSched($subValue, $value);
40
+//                    if ($subValue['film_sign'] == 'F6556061D4' && $value['cinema_sign'] == 'CCB622D8D8') {
41
+//                    }
40 42
                 }
41 43
             }
42 44
         } catch (\Exception $exception) {

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

@@ -123,22 +123,18 @@ class MovieRepository extends BaseRepository
123 123
     {
124 124
         $result = DouHuoMallFilmApiRequest::getSchedSeat($relation_id, $sched_sign);
125 125
 
126
-        $schedSeatList = (isset($result['code']) && ($result['code'] == ApiResponseService::DEFAULT_SUCCESS_CODE))
127
-            ? $result['data']['list'] : [];
126
+        $schedSeatList = (isset($result['code']) && ($result['code'] == ApiResponseService::DEFAULT_SUCCESS_CODE)) ? $result['data'] : [];
128 127
         foreach ($schedSeatList as $key => $value) {
129
-            $tmpprice = json_decode($value['price'], true);
130
-            if (isset($tmpprice['P2'])) {
131
-                $price = $tmpprice['P2'];
132
-            } elseif (isset($tmpprice['P1'])) {
133
-                $price = $tmpprice['P1'];
134
-            } elseif (isset($tmpprice['P0'])) {
135
-                $price = $tmpprice['P0'];
136
-            } else {
137
-                $price = 0.00;
128
+            $tmpprice = [];
129
+            foreach ($value['price'] as $pKey => $pValue) {
130
+                $tmpprice[$pValue] = ['channel_type' => $pKey, 'price' => $pValue];
138 131
             }
132
+            ksort($tmpprice);
133
+            $tmpprice = array_shift($tmpprice);
139 134
             unset($schedSeatList[$key]['price']);
140 135
 
141
-            $pcYanglaojinGongxian = self::getPvYanglaojinScore($price);
136
+            $pcYanglaojinGongxian = self::getPvYanglaojinScore($tmpprice['price']);
137
+            $schedSeatList[$key]['channel_type'] = $tmpprice['channel_type'];
142 138
             $schedSeatList[$key]['price'] = $pcYanglaojinGongxian['cost_price'];
143 139
             $schedSeatList[$key]['yanglaojin'] = $pcYanglaojinGongxian['yanglaojin'];
144 140
             $schedSeatList[$key]['pv'] = $pcYanglaojinGongxian['pv'];