fix : coupon date
This commit is contained in:
@@ -13,6 +13,7 @@ namespace App\Cron\Coupon;
|
|||||||
use App\Constants\Common\CouponCode;
|
use App\Constants\Common\CouponCode;
|
||||||
use App\Lib\Log;
|
use App\Lib\Log;
|
||||||
use App\Model\UserCoupon;
|
use App\Model\UserCoupon;
|
||||||
|
use Exception;
|
||||||
use Hyperf\Crontab\Annotation\Crontab;
|
use Hyperf\Crontab\Annotation\Crontab;
|
||||||
use Hyperf\Di\Annotation\Inject;
|
use Hyperf\Di\Annotation\Inject;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ class UserCouponTask
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->userCouponModel
|
$this->userCouponModel
|
||||||
->whereTime('validity_end_time', '<', date('Y-m-d H:i:s'))
|
->whereTime('validity_end_time', '>', date('Y-m-d H:i:s'))
|
||||||
->where('status', CouponCode::COUPON_STATUS_UNUSED)
|
->where('status', CouponCode::COUPON_STATUS_UNUSED)
|
||||||
->update(['status' => CouponCode::COUPON_STATUS_EXPIRE]);
|
->update(['status' => CouponCode::COUPON_STATUS_EXPIRE]);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
|
|||||||
Reference in New Issue
Block a user