feat : auto coupon

This commit is contained in:
2025-02-27 10:05:48 +08:00
parent c8db3e170d
commit 81bc1d5456
6 changed files with 136 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Model;
use App\Constants\Common\CouponCode;
use Hyperf\DbConnection\Model\Model;
/**
@@ -66,6 +67,9 @@ class CouponDispenseUser extends Model
{
return $this
->whereIn('user_id', $userIds)
->increment('receive_count', $count);
->update([
'receive_count' => $count,
'is_receive' => CouponCode::DISPENSE_STATUS_IS_RECEIVED
]);
}
}