功能:职务奖励金币发放系统
数据库: - positions 新增 daily_reward_limit(单日累计上限) - positions 新增 recipient_daily_limit(同一接收者每日次数上限) 后端: - CurrencySource::POSITION_REWARD 新枚举值 - AdminCommandController::reward() 三层限额校验 ① 单次上限 ② 单日累计上限 ③ 同一接收者每日次数 写履职记录(PositionAuthorityLog)+ UserCurrencyService 聊天室悄悄话通知接收者 - POST /command/reward 路由注册 前端(user-actions.blade.php): - 名片按钮行 2+1 布局(加好友/送礼物/送金币) - 送金币仅在 myMaxReward>0 时显示(职务持有者) - 内联奖励金币面板:金额输入 + 确认发放 + 说明文字 - sendReward() 前端校验 + API 调用 + chatDialog 反馈 后台(positions/index): - 编辑表单新增两个奖励限额字段 - PositionController 验证规则同步更新
This commit is contained in:
@@ -24,13 +24,15 @@
|
||||
level: 60,
|
||||
max_persons: 1,
|
||||
max_reward: '',
|
||||
daily_reward_limit: '',
|
||||
recipient_daily_limit: '',
|
||||
sort_order: 0
|
||||
},
|
||||
|
||||
openCreate() {
|
||||
this.editing = null;
|
||||
this.selectedIds = [];
|
||||
this.form = { department_id: '', name: '', icon: '🎖️', rank: 50, level: 60, max_persons: 1, max_reward: '', sort_order: 0 };
|
||||
this.form = { department_id: '', name: '', icon: '🎖️', rank: 50, level: 60, max_persons: 1, max_reward: '', daily_reward_limit: '', recipient_daily_limit: '', sort_order: 0 };
|
||||
this.showForm = true;
|
||||
},
|
||||
openEdit(pos, appointableIds) {
|
||||
@@ -44,6 +46,8 @@
|
||||
level: pos.level,
|
||||
max_persons: pos.max_persons || '',
|
||||
max_reward: pos.max_reward || '',
|
||||
daily_reward_limit: pos.daily_reward_limit || '',
|
||||
recipient_daily_limit: pos.recipient_daily_limit || '',
|
||||
sort_order: pos.sort_order,
|
||||
};
|
||||
this.showForm = true;
|
||||
@@ -170,6 +174,8 @@
|
||||
level: {{ $pos->level }},
|
||||
max_persons: {{ $pos->max_persons ?? 'null' }},
|
||||
max_reward: {{ $pos->max_reward ?? 'null' }},
|
||||
daily_reward_limit: {{ $pos->daily_reward_limit ?? 'null' }},
|
||||
recipient_daily_limit: {{ $pos->recipient_daily_limit ?? 'null' }},
|
||||
sort_order: {{ $pos->sort_order }},
|
||||
requestUrl: '{{ route('admin.positions.update', $pos->id) }}'
|
||||
}, {{ json_encode($appointableIds) }})"
|
||||
@@ -251,9 +257,21 @@
|
||||
class="w-full border rounded-md p-2 text-sm" placeholder="留空不限">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">单次奖励上限金币(空=不限)</label>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">单次奖励上限(空=不限)</label>
|
||||
<input type="number" name="max_reward" x-model="form.max_reward" min="0"
|
||||
class="w-full border rounded-md p-2 text-sm" placeholder="留空不限">
|
||||
class="w-full border rounded-md p-2 text-sm" placeholder="每次最多可发放金币数">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">单日发放总上限(空=不限)</label>
|
||||
<input type="number" name="daily_reward_limit" x-model="form.daily_reward_limit"
|
||||
min="0" class="w-full border rounded-md p-2 text-sm"
|
||||
placeholder="操作人每日总计可发金币">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">同人每日次数上限(空=不限)</label>
|
||||
<input type="number" name="recipient_daily_limit" x-model="form.recipient_daily_limit"
|
||||
min="0" class="w-full border rounded-md p-2 text-sm"
|
||||
placeholder="同一接收者每天最多收几次">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">排序</label>
|
||||
|
||||
Reference in New Issue
Block a user