Browse Source

获取用户已领取优惠券列表

master
parent
commit
55beb100ae
  1. 8
      app/Controller/CouponController.php

8
app/Controller/CouponController.php

@ -159,16 +159,16 @@ class CouponController extends BaseController
foreach ($coupons as $key => $coupon) {
//拼接满减文字提示
$coupon->full_amount = '满' . $coupon->full_amount . "可用";
$coupon->full_amount_text = '满' . $coupon->full_amount . "可用";
//判断是折扣优惠券还是满减优惠券
if($coupon->discount_type == 1){
$coupon->discounts = '¥'.$coupon->discounts;
$coupon->discounts_text = '¥'.$coupon->discounts;
}elseif($coupon->discount_type == 2){
$coupon->discounts = floatval($coupon->discounts)."";
$coupon->discounts_text = floatval($coupon->discounts)."";
}
//失效时间格式转换
$usable_end_time = date('Y-m-d H:i:s',$coupon->usable_end_time);
$coupon->usable_end_time = '有效期至:'.$usable_end_time;
$coupon->usable_end_time_text = '有效期至:'.$usable_end_time;
if ($coupon->usable_end_time < $nowTime || $coupon->number_remain <= 0) {
$expired[] = $coupon;

Loading…
Cancel
Save