Prechádzať zdrojové kódy

下单页面使用优惠券的限时使用时间段显示有误

evoxwht 2 rokov pred
rodič
commit
525498b6e5

+ 4 - 0
crmeb/app/api/controller/v1/store/StoreCouponsController.php

@@ -50,6 +50,9 @@ class StoreCouponsController
      * 领取优惠券
      * @param Request $request
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function receive(Request $request)
     {
@@ -82,6 +85,7 @@ class StoreCouponsController
      * @param StoreCouponIssueServices $service
      * @param $cartId
      * @param $new
+     * @param $shippingType
      * @return mixed
      * @throws \Psr\SimpleCache\InvalidArgumentException
      * @throws \think\db\exception\DataNotFoundException

+ 2 - 0
crmeb/app/services/activity/coupon/StoreCouponUserServices.php

@@ -170,6 +170,8 @@ class StoreCouponUserServices extends BaseServices
                     $coupon['start_time'] = $coupon['start_time'] ? date('Y/m/d', $coupon['start_time']) : date('Y/m/d', $coupon['add_time']);
                     $coupon['add_time'] = date('Y/m/d', $coupon['add_time']);
                     $coupon['end_time'] = date('Y/m/d', $coupon['end_time']);
+                    $coupon['start_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['start_use_time']) : 0;
+                    $coupon['end_use_time'] = $coupon['start_use_time'] > 0 ? date('Y/m/d', $coupon['end_use_time']) : 0;
                     $coupon['title'] = $coupon['coupon_title'];
                     $coupon['type'] = $coupon['applicable_type'];
                     $coupon['use_min_price'] = floatval($coupon['use_min_price']);