feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录

这个提交包含在:
chen
2026-09-17 19:27:17 +08:00
父节点 3c7df9688b
当前提交 829e88cfa9
共有 54 个文件被更改,包括 3536 次插入 和 666 次删除

查看文件

@@ -40,6 +40,7 @@ class Index extends Commission
{
$userId = $this->service->user->id;
$tab = $this->request->param('tab', 'all');
$buyerId = intval($this->request->param('buyer_id', 0));
$query = RewardModel::where('user_id', $userId)->with(['buyer', 'order']);
$tabMap = [
@@ -52,6 +53,9 @@ class Index extends Commission
if ($tab !== 'all' && isset($tabMap[$tab])) {
$query->whereIn('reward_type', $tabMap[$tab]);
}
if ($buyerId > 0) {
$query->where('buyer_id', $buyerId);
}
$list = $query->order('id', 'desc')->paginate($this->request->param('list_rows', 10));
$rows = [];
@@ -74,11 +78,26 @@ class Index extends Commission
];
}
$buyerInfo = null;
if ($buyerId > 0) {
$buyerUser = \app\admin\model\shopro\user\User::get($buyerId);
if ($buyerUser) {
$rawMobile = (string) ($buyerUser->mobile ?? '');
$buyerInfo = [
'id' => $buyerUser->id,
'nickname' => $buyerUser->nickname,
'avatar' => $buyerUser->avatar,
'mobile' => $rawMobile ? (strlen($rawMobile) == 11 ? substr_replace($rawMobile, '****', 3, 4) : $rawMobile) : '',
];
}
}
$this->success('ok', [
'total' => $list->total(),
'per_page' => $list->listRows(),
'current_page' => $list->currentPage(),
'data' => $rows,
'buyer_info' => $buyerInfo,
]);
}