浏览代码

优惠券自动过期计划任务

gorden 6 月之前
父节点
当前提交
347de83c06
共有 2 个文件被更改,包括 15 次插入2 次删除
  1. 7 0
      app/admin/service/coupon/CouponService.php
  2. 8 2
      app/event/order/OrderProcessEvent.php

+ 7 - 0
app/admin/service/coupon/CouponService.php

@@ -7,6 +7,13 @@ use support\Db;
 
 class CouponService
 {
+    /**
+     * @Desc 优惠券自动过期
+     * @Author Gorden
+     * @Date 2024/8/26 17:58
+     *
+     * @return void
+     */
     public static function checkCouponExpired()
     {
         $couponDetails = Db::select("select * from app_coupon_detail where (coupon_detail_status = 'INIT' OR coupon_detail_status = 'PENDING' OR coupon_detail_status = 'ACTIVED' OR coupon_detail_status = 'WAITING') AND coupon_detail_deadline_datetime != '' AND CAST(UNIX_TIMESTAMP(coupon_detail_deadline_datetime) as SIGNED) < ".time());

+ 8 - 2
app/event/order/OrderProcessEvent.php

@@ -1,11 +1,17 @@
 <?php
 
-namespace app\event;
+namespace app\event\order;
+
+use support\Log;
 
 class OrderProcessEvent
 {
     public function insert($params)
     {
-
+        try {
+            
+        }catch (\Exception $e){
+            Log::error("WRITE_ORDER_PROCESS_ERROR",$params);
+        }
     }
 }