WIN-2308041133\Administrator 5 dni temu
rodzic
commit
dd5996ca3a

+ 8 - 4
app/services/activity/coupon/StoreCouponUserServices.php

@@ -151,21 +151,25 @@ class StoreCouponUserServices extends BaseServices
             }
             @file_put_contents("quanju.txt", $hasRepeat."-是否是复购商品\r\n", 8);
             @file_put_contents("quanju.txt", $hasFree."-是否是50元兑换商品\r\n", 8);
+            @file_put_contents("quanju.txt", json_encode($userCoupons)."-用户所有优惠券数据\r\n", 8);
 
             foreach ($userCoupons as $coupon) {
                 $couponType = (int)$coupon['applicable_type'];
-                @file_put_contents("quanju.txt", $couponType."-优惠卷类型\r\n", 8);
+                @file_put_contents("quanju.txt", "优惠券ID:".$coupon['id'].", 类型:".$couponType."-优惠卷类型\r\n", 8);
 
-                // is_repeat 为 1:只显示 type=2 的优惠券
+                // is_repeat 为 1:只显示 type=3 的优惠券
                 if ($hasRepeat && $couponType !== 3) {
+                    @file_put_contents("quanju.txt", "跳过:复购商品但类型不是3\r\n", 8);
                     continue;
                 }
-                // is_free 为 1:只显示 type=3 的优惠券
+                // is_free 为 1:只显示 type=4 的优惠券
                 if ($hasFree && $couponType !== 4) {
+                    @file_put_contents("quanju.txt", "跳过:50元兑换商品但类型不是4\r\n", 8);
                     continue;
                 }
-                // is_repeat 和 is_free 都不为 1:隐藏 type=2 和 type=3 的优惠券
+                // is_repeat 和 is_free 都不为 1:隐藏 type=3 和 type=4 的优惠券
                 if (!$hasRepeat && !$hasFree && ($couponType === 3 || $couponType === 4)) {
+                    @file_put_contents("quanju.txt", "跳过:普通商品但类型是3或4\r\n", 8);
                     continue;
                 }