coupon_detail_deadline_datetime); if ($endTimeUnix < time()) { CouponDetail::where('coupon_detail_id', $detail->coupon_detail_id)->update(['coupon_detail_status' => 'EXPIRED']); echo $detail->coupon_detail_id . "已过期\n"; } } } public static function couponClassifyInfo($classify, $category, $value, $limit) { try { switch ($classify) { case "满减券": if (!empty($limit) && $category == 'NORMAL') { return "满" . $limit . '减' . $value; }elseif (!empty($limit) && !empty($value) && $category == 'PIECE'){ return "满" . intval($limit) . '件减' . $value; } break; case "立减券": return "立减" . $value; break; case "抵用券": return "抵用券"; break; case "折扣券": if (!empty($limit) && $category == 'NORMAL') { return "满" . $limit . '打' . ($value / 10) . '折'; }else if (!empty($limit) && !empty($value) && $category == 'PIECE') { return "满" . intval($limit) . '件打' . ($value / 10) . '折'; } else { return $value/10 . '折'; } break; case "赠品券": return "赠品券"; break; case "福利券": return '抵扣' . $value; break; case "年卡": return "年卡"; break; case "季卡": return "季卡"; break; case "月卡": return "月卡"; break; } } catch (\Exception $e) { } } }