优化ai小班长

This commit is contained in:
2026-04-12 22:42:32 +08:00
parent d739fc7028
commit 353aaaf6ce
6 changed files with 36 additions and 36 deletions
+4 -4
View File
@@ -5,7 +5,7 @@
*
* 统一维护 AI小班长的银行存取与阶段性理财里程碑公告,
* 常规场景下仅在手上金币超过 100 万时自动存银行,
* 特殊场景(如买单活动全仓下注)才会动用银行资产。
* 特殊场景(如买单活动的大额下注)才会动用银行资产。
*/
namespace App\Services;
@@ -17,7 +17,7 @@ use App\Models\User;
use Illuminate\Support\Facades\DB;
/**
* 负责 AI小班长的常规存款、全仓取款与里程碑播报。
* 负责 AI小班长的常规存款、大额调款与里程碑播报。
*/
class AiFinanceService
{
@@ -74,9 +74,9 @@ class AiFinanceService
}
/**
* 全仓支出准备手头金币。
* 大额支出准备手头金币。
*
* 该模式不会保留手上余额阈值,适用于买单活动等可接受全额下注的场景。
* 该模式不会保留手上余额阈值,适用于买单活动等需要临时调拨银行金币的场景。
*/
public function prepareAllInSpend(User $user, int $spendAmount): bool
{
+5 -1
View File
@@ -105,13 +105,17 @@ class BaccaratLossCoverService
/**
* 获取某个下注时间点命中的活动。
*
* 这里按管理员设定的开始/结束时间窗口判断,
* 不强依赖后台状态已经及时切到 active
* 这样刚到开始时间的活动也能立即参与买单判定。
*/
public function findEventForBetTime(?Carbon $betTime = null): ?BaccaratLossCoverEvent
{
$betTime = $betTime ?? now();
return BaccaratLossCoverEvent::query()
->whereIn('status', ['active', 'settlement_pending', 'claimable'])
->whereNotIn('status', ['cancelled', 'completed'])
->where('starts_at', '<=', $betTime)
->where('ends_at', '>=', $betTime)
->orderByDesc('id')