cqpCow 1 rok temu
rodzic
commit
05ef74e62e
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      app/Service/BookingListService.php

+ 5 - 4
app/Service/BookingListService.php

@@ -225,14 +225,15 @@ class BookingListService extends Service
             ->where('state',BookingList::STATE_ONE)
             ->whereIn('data_id',$data_id)
             ->where('data_type',$data_type)
-            ->select('data_id','amount');
+            ->select('data_id','amount','type')
+            ->get()->toArray();
 
         $return = [];
         foreach ($booking as $value){
-            if(isset($return[$value['data_id']][$value['data_type']])){
-                $return[$value['data_id']][$value['data_type']] += $value['amount'];
+            if(isset($return[$value['data_id']][$value['type']])){
+                $return[$value['data_id']][$value['type']] += $value['amount'];
             }else{
-                $return[$value['data_id']][$value['data_type']] = $value['amount'];
+                $return[$value['data_id']][$value['type']] = $value['amount'];
             }
         }