修复:单次上限三态逻辑(null=不限/-1=不限/0=禁止/正整数=有上限)

frame.blade.php:
- max_reward=null → myMaxReward=-1(不限,有权限)
- max_reward=0   → myMaxReward=0(禁止发放)
- max_reward=N   → myMaxReward=N(有具体上限)

user-actions.blade.php:
- 按钮显示条件:myMaxReward !== 0(-1 和正整数都显示)
- 面板上限文字:-1 显示「不限」,正整数显示具体数值
- sendReward 校验:0=禁止阻断,-1=不限跳过上限校验,N=有上限
- 输入框 :max:-1 时上限 999999(实际不限),N 时上限 N
This commit is contained in:
2026-03-01 11:39:28 +08:00
parent 57f515e2eb
commit 8dcf23d7e4
2 changed files with 19 additions and 6 deletions
+5 -1
View File
@@ -46,7 +46,11 @@
chatBotClearUrl: "{{ route('chatbot.clear') }}",
chatBotEnabled: {{ \App\Models\Sysparam::getValue('chatbot_enabled', '0') === '1' ? 'true' : 'false' }},
hasPosition: {{ Auth::user()->activePosition || Auth::user()->user_level >= $superLevel ? 'true' : 'false' }},
myMaxReward: {{ Auth::user()->activePosition?->position?->max_reward ?? 0 }},
myMaxReward: @php
$pos = Auth::user()->activePosition?->position;
// -1 = 有权限但无上限(null),0 = 禁止,正整数 = 有具体上限
echo $pos ? ($pos->max_reward === null ? -1 : (int) $pos->max_reward) : 0;
@endphp,
appointPositionsUrl: "{{ route('chat.appoint.positions') }}",
appointUrl: "{{ route('chat.appoint.appoint') }}",
revokeUrl: "{{ route('chat.appoint.revoke') }}",