feat : coupon

This commit is contained in:
2025-02-27 15:32:36 +08:00
parent 81bc1d5456
commit d046b34cea
11 changed files with 338 additions and 17 deletions

View File

@@ -72,4 +72,17 @@ class CouponDispenseUser extends Model
'is_receive' => CouponCode::DISPENSE_STATUS_IS_RECEIVED
]);
}
/**
* @param array $userIds
* @return array
*/
public function getNoReceiveCountByUserIds(array $userIds): array
{
return $this
->whereIn('user_id', $userIds)
->where('receive_count',CouponCode::DISPENSE_STATUS_IS_NO_RECEIVED)
->pluck('coupon_dispense_id')
->toArray();
}
}