39 lines
773 B
PHP
39 lines
773 B
PHP
<?php
|
|
/**
|
|
* This service file is part of item.
|
|
*
|
|
* @author ctexthuang
|
|
* @contact ctexthuang@qq.com
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Service\Api\System;
|
|
|
|
use App\Constants\Common\CouponCode;
|
|
use App\Model\UserCoupon;
|
|
use App\Service\Api\BaseService;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
|
|
class TestService extends BaseService
|
|
{
|
|
|
|
/**
|
|
* @var UserCoupon
|
|
*/
|
|
#[Inject]
|
|
protected UserCoupon $userCouponModel;
|
|
|
|
public function handle()
|
|
{
|
|
var_dump(date('Y-m-d H:i:s'));
|
|
$data = $this->userCouponModel
|
|
->where('status', CouponCode::COUPON_STATUS_UNUSED)
|
|
->where('validity_end_time', '<', date('Y-m-d H:i:s'))
|
|
->get();
|
|
|
|
$data = $data->toArray();
|
|
|
|
var_dump($data);
|
|
}
|
|
} |