feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能
- 新增 invoice_title、showcase、wallet_log 模型及对应语言包 - 新增后台控制器、视图及搜索字段配置 - 修复服务类目删除保护逻辑 - 优化后台登录页面文案及样式 - 新增前端角色切换逻辑及页面拦截 - 新增 SVG 图标及样式变量 - 修复接口权限及下拉框默认值问题
这个提交包含在:
@@ -84,7 +84,10 @@ class Base extends Api
|
||||
$this->error('订单不存在');
|
||||
}
|
||||
if ($side === 'user' && (int)$order['user_id'] !== $this->uid()) {
|
||||
$this->error('无权操作该订单', null, 403);
|
||||
$team = $this->currentMerchantTeam();
|
||||
if (!$team || !in_array((int)$order['user_id'], $team['user_ids'], true)) {
|
||||
$this->error('无权操作该订单', null, 403);
|
||||
}
|
||||
}
|
||||
if ($side === 'master') {
|
||||
$master = $this->requireMaster();
|
||||
@@ -95,6 +98,40 @@ class Base extends Api
|
||||
return $order;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户所属的已认证商家团队(主账号 + 关联子账号)
|
||||
* @return array|null ['merchant' => array, 'user_ids' => int[]]
|
||||
*/
|
||||
protected function currentMerchantTeam()
|
||||
{
|
||||
$uid = $this->uid();
|
||||
if ($uid <= 0) {
|
||||
return null;
|
||||
}
|
||||
$merchant = Db::name('merchant')->where('user_id', $uid)->find();
|
||||
if (!$merchant) {
|
||||
$bind = Db::name('merchant_member')->where('user_id', $uid)->find();
|
||||
if ($bind) {
|
||||
$merchant = Db::name('merchant')->where('id', (int)$bind['merchant_id'])->find();
|
||||
}
|
||||
}
|
||||
if (!$merchant || $merchant['verify_status'] !== 'pass') {
|
||||
return null;
|
||||
}
|
||||
$ids = [(int)$merchant['user_id']];
|
||||
$rows = Db::name('merchant_member')->where('merchant_id', (int)$merchant['id'])->column('user_id');
|
||||
foreach ($rows as $id) {
|
||||
$id = (int)$id;
|
||||
if ($id > 0 && !in_array($id, $ids, true)) {
|
||||
$ids[] = $id;
|
||||
}
|
||||
}
|
||||
return [
|
||||
'merchant' => $merchant,
|
||||
'user_ids' => $ids,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单状态流转:校验 → 更新 → 写流水
|
||||
*/
|
||||
|
||||
在新工单中引用
屏蔽一个用户