wesmiler 3 달 전
부모
커밋
1b3c9ac093
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      app/Services/Api/OrderService.php

+ 7 - 4
app/Services/Api/OrderService.php

@@ -80,18 +80,21 @@ class OrderService extends BaseService
             ->paginate($pageSize > 0 ? $pageSize : 9999999);
         $list = $list ? $list->toArray() : [];
         if ($list) {
-            $statusArr = [1 => '接单中', 2 => '进行中', 3 => '已完成'];
+            $statusArr = [1 => '待支付', 2 => '待发货', 3 => '待收货',4=>'确认收货'];
+            $refundStatusArr = [1 => '已退款', 2 => '退款中', 3 => '退款审核',4=>'退款驳回'];
             foreach ($list['data'] as &$item) {
                 $item['create_time'] = $item['create_time'] ? datetime($item['create_time'], 'Y-m-d H:i:s') : '';
                 $status = isset($item['status']) ? $item['status'] : 0;
-                $item['status_text'] = '接单中';
+                $item['status_text'] = '待支付';
                 if ($status) {
                     $item['status_text'] = isset($statusArr[$status]) ? $statusArr[$status] : '';
                 }
 
+                if($item['refund_status']>0){
+                    $item['status_text'] = isset($refundStatusArr[$item['refund_status']]) ? $refundStatusArr[$item['refund_status']] : $item['status_text'];
+                }
+
                 $item['goods'] = isset($item['goods']) && $item['goods'] ? $item['goods'] : [];
-                $item['goods']['shipper_phone_text'] = $item['goods']['shipper_phone'] ? format_mobile($item['goods']['shipper_phone']) : '';
-                $item['goods']['receiver_phone_text'] = $item['goods']['receiver_phone'] ? format_mobile($item['goods']['receiver_phone']) : '';
             }
             unset($item);
         }