新增amqp队列,新增订单创建
This commit is contained in:
@@ -40,7 +40,7 @@ class UserCoupon extends Model
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['user_coupon_id' => 'integer', 'user_id' => 'integer', 'patient_id' => 'integer', 'coupon_id' => 'integer', 'user_coupon_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $casts = ['user_coupon_id' => 'string', 'user_id' => 'string', 'patient_id' => 'string', 'coupon_id' => 'string', 'user_coupon_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "user_coupon_id";
|
||||
|
||||
@@ -70,15 +70,32 @@ class UserCoupon extends Model
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getWithCouponList(array $params,array $coupon_params, array $fields = ['*']): Collection|array
|
||||
public static function getWithCouponList(array $params,array $coupon_params,array $application_scope_params, array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon' , function($query) use ($coupon_params){
|
||||
$query->where($coupon_params);
|
||||
->whereHas('Coupon' , function($query) use ($coupon_params,$application_scope_params){
|
||||
$query->where($coupon_params)->whereIn('application_scope',$application_scope_params);
|
||||
})
|
||||
->where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取优惠卷信息-单条
|
||||
* @param array $params
|
||||
* @param array $coupon_params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getWithCouponOne(array $params,array $coupon_params, array $application_scope_params,array $fields = ['*']): object|null
|
||||
{
|
||||
return self::with(['Coupon'])
|
||||
->whereHas('Coupon' , function($query) use ($coupon_params,$application_scope_params){
|
||||
$query->where($coupon_params)->whereIn('application_scope',$application_scope_params);
|
||||
})
|
||||
->where($params)
|
||||
->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户优惠卷
|
||||
* @param array $data
|
||||
|
||||
Reference in New Issue
Block a user