feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录
这个提交包含在:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户