|
|
@@ -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'];
|