diff --git a/app/admin/lists/store_order/StoreOrderLists.php b/app/admin/lists/store_order/StoreOrderLists.php index 3da16980..90dfddcc 100644 --- a/app/admin/lists/store_order/StoreOrderLists.php +++ b/app/admin/lists/store_order/StoreOrderLists.php @@ -64,7 +64,11 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface ->order(['id' => 'desc']) ->select()->each(function ($item) { $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : ''; - $item['status_name'] = OrderEnum::getOrderType($item['status']) ?? ''; + if($item['status']==-1){ + $item['status_name'] = OrderEnum::refundStatus($item['refund_status']) ?? ''; + }else{ + $item['status_name'] = OrderEnum::getOrderType($item['status']) ?? ''; + } if ($item['uid'] <= 0) { $item['nickname'] = '游客'; } else { diff --git a/app/common/enum/OrderEnum.php b/app/common/enum/OrderEnum.php index 8ffae83e..6674b96a 100644 --- a/app/common/enum/OrderEnum.php +++ b/app/common/enum/OrderEnum.php @@ -180,10 +180,6 @@ class OrderEnum */ public static function getOrderType($value = true) { - if($value==-1){ - $status = self::refundStatus($value) ?? ''; - return $status; - } $data = [ self::RECEIVED_GOODS => '已完成', self::WAIT_EVALUATION => '待评价', diff --git a/app/common/model/store_order/StoreOrder.php b/app/common/model/store_order/StoreOrder.php index 90b1efcc..69b1b301 100644 --- a/app/common/model/store_order/StoreOrder.php +++ b/app/common/model/store_order/StoreOrder.php @@ -40,8 +40,11 @@ class StoreOrder extends BaseModel public function getStatusNameTextAttr($value, $data) { - - $status = OrderEnum::getOrderType($data['status']) ?? ''; + if($data['status']==-1){ + $status = OrderEnum::refundStatus($data['refund_status']) ?? ''; + }else{ + $status = OrderEnum::getOrderType($data['status']) ?? ''; + } return $status; }