23 lines
571 B
PHP
23 lines
571 B
PHP
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\subscribe;
|
|
|
|
use app\model\CouponMain;
|
|
use think\facade\Log;
|
|
|
|
class Coupon
|
|
{
|
|
/**
|
|
* 检查过期的签到券修改状态
|
|
* */
|
|
public function onCouponStatusCheck()
|
|
{
|
|
$count = CouponMain::whereTime("end_time", "<", date("Y-m-d"))->where(["status" => CouponMain::status_on])->count();
|
|
if ($count) {
|
|
Log::info("修改了签到券状态" . $count);
|
|
CouponMain::whereTime("end_time", "<", date("Y-m-d"))->update(["status" => CouponMain::status_off]);
|
|
}
|
|
}
|
|
}
|