|
|
|
@ -58,7 +58,7 @@ class AdminAgentTeam extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
# 查询用户列表 |
|
|
|
$field = 'id,phone,avatar,balance,withdrawal_balance,status'; |
|
|
|
$field = 'id,aid,phone,avatar,balance,withdrawal_balance,status'; |
|
|
|
$userRes = $UserModel->field($field)->where($where)->order('id desc')->paginate($limit); |
|
|
|
|
|
|
|
$list = $userRes->items(); |
|
|
|
@ -72,6 +72,8 @@ class AdminAgentTeam extends BaseController |
|
|
|
# 获取返点占比 |
|
|
|
$rebate_ratio = $AgentInfo->where('aid',$item['id'])->value('rebate_ratio'); |
|
|
|
$item['rebate_ratio'] = $rebate_ratio * 100; |
|
|
|
$item['grade'] = empty($item['aid']) ? '1级' : 'id:' . $item['aid']; |
|
|
|
unset($item['aid']); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderSuccess('数据返回成功', ['list' => $list, 'total' => $total]); |
|
|
|
@ -199,12 +201,15 @@ class AdminAgentTeam extends BaseController |
|
|
|
# 保存返点占比 |
|
|
|
if (strlen($rebate_ratio) > 0) { |
|
|
|
$rebate_ratio = $param['rebate_ratio'] ?? 0; |
|
|
|
$validateAgentRebateRatio = validate(Agent::class)->validateAgentRebateRatio($param['aid'],$rebate_ratio); |
|
|
|
if ($validateAgentRebateRatio !== true) throw new ValidateException($validateAgentRebateRatio); |
|
|
|
AgentInfo::updateRebateRatio($param['aid'],$rebate_ratio); |
|
|
|
} |
|
|
|
|
|
|
|
$connection->commit(); |
|
|
|
return $this->renderSuccess('成功'); |
|
|
|
} catch (ValidateException $validateException) { |
|
|
|
$connection->rollback(); |
|
|
|
return $this->renderError($validateException->getMessage()); |
|
|
|
} catch (\Exception $exception) { |
|
|
|
$connection->rollback(); |
|
|
|
|