修改优惠卷过期数据
This commit is contained in:
@@ -6,6 +6,7 @@ namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
@@ -19,8 +20,8 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $coupon_use_date 使用时间
|
||||
* @property string $valid_start_time 开始使用时间
|
||||
* @property string $valid_end_time 过期使用时间
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
* @property-read Coupon $Coupon
|
||||
*/
|
||||
class UserCoupon extends Model
|
||||
@@ -183,4 +184,18 @@ class UserCoupon extends Model
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者今日过期优惠卷
|
||||
* @param array $params
|
||||
* @param array $valid_end_time
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getUserTodayExpiredCoupon(array $params,array $valid_end_time,array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)
|
||||
// ->where('valid_start_time',">=","2024-05-01 00:00:00") // 此处是为了区分于1.3版本上线前的优惠卷
|
||||
->whereBetween('valid_end_time', $valid_end_time)
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user