From 1daf123baa6bba8a412b524c35c5014d704a5e00 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Thu, 29 Oct 2020 10:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Activity/IndexController.php | 2 +- app/Models/Activity.php | 2 +- packages/coupon/src/Action/ysd/YsdGrant.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Admin/Controllers/Activity/IndexController.php b/app/Admin/Controllers/Activity/IndexController.php index 7309f65..b7b7e02 100644 --- a/app/Admin/Controllers/Activity/IndexController.php +++ b/app/Admin/Controllers/Activity/IndexController.php @@ -204,7 +204,7 @@ class IndexController extends AdminController if ($request->total < 0) { $error = new MessageBag([ 'title' => '错误', - 'message' => '可发券总数必须大于0.', + 'message' => '可发券总数必须大于0', ]); return back()->withInput()->with(compact('error')); diff --git a/app/Models/Activity.php b/app/Models/Activity.php index c763c29..426dd5a 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -100,7 +100,7 @@ class Activity extends Model { try { - $code = '66406' . date('ymd') . mt_rand(100000, 999999); + $code = 'YSD' . date('ymd') . mt_rand(100000, 999999); if ($this->type == SELF::TYPE_EXTEND) { $start_at = now(); diff --git a/packages/coupon/src/Action/ysd/YsdGrant.php b/packages/coupon/src/Action/ysd/YsdGrant.php index 509eefb..c414d2d 100644 --- a/packages/coupon/src/Action/ysd/YsdGrant.php +++ b/packages/coupon/src/Action/ysd/YsdGrant.php @@ -22,7 +22,7 @@ class YsdGrant extends Init if (!$activity->status) { return '发券失败,活动已经关闭。'; } - + if ($activity->type == Activity::TYPE_SCOPE && Carbon::now()->gt($activity->end_at)) { return '发券失败,此活动已经结束。'; }