فهرست منبع

添加会员plus返回时间

llp 1 هفته پیش
والد
کامیت
b255a9414e

+ 6 - 0
packages/Webkul/BagistoApi/src/Dto/CartData.php

@@ -146,6 +146,10 @@ class CartData
     #[ApiProperty(description: 'Whether the current customer is a VIP member')]
     public ?bool $isVip = null;
 
+    #[Groups(['query', 'mutation'])]
+    #[ApiProperty(description: 'VIP Plus expiration date')]
+    public ?string $vipExpireDate = null;
+
     #[Groups(['query', 'mutation'])]
     public ?bool $success = null;
 
@@ -336,11 +340,13 @@ class CartData
 
         // VIP status
         $data->isVip = false;
+        $data->vipExpireDate = null;
         if ($cart->customer_id) {
             $customer = \Webkul\Customer\Models\Customer::find($cart->customer_id);
             if ($customer && $customer->vip_expire_date) {
                 $expireDate = \Carbon\Carbon::parse($customer->vip_expire_date);
                 $data->isVip = !$expireDate->isPast();
+                $data->vipExpireDate = $expireDate->toIso8601String();
             }
         }
 

+ 2 - 0
packages/Webkul/BagistoApi/src/Resources/config/serializer/CartData.yaml

@@ -87,6 +87,8 @@ Webkul\BagistoApi\Dto\CartData:
       type: string
     isVip:
       type: bool
+    vipExpireDate:
+      type: string
     isGuest:
       type: bool
     itemsQty: