Commit 03ea6509 authored by 刘小敏's avatar 刘小敏

feat(agent): 添加代理商详情接口并移除申请省区参数

parent 18bb1b13
......@@ -24,7 +24,7 @@ class Agent extends Common
$userId = $user->id ?? 0;
custom_log('[agent.apply] 收到代理申请请求, user_id=' . $userId, $userId, 'share');
$params = $this->request->only(['province_id', 'real_name', 'id_card', 'id_card_images']);
$params = $this->request->only(['real_name', 'id_card', 'id_card_images']);
custom_log('[agent.apply] 解析参数: ' . json_encode($params, JSON_UNESCAPED_UNICODE), $userId, 'share');
$this->svalidate($params, '\addons\shopro\validate\user\User.agentApply');
......@@ -40,4 +40,25 @@ class Agent extends Common
$this->error($e->getMessage());
}
}
/**
* 获取代理商详情
* GET /addons/shopro/user.agent/detail
*/
public function detail()
{
$user = auth_user();
$userId = $user->id ?? 0;
$agent = \app\admin\model\shopro\agent\Agent::where('user_id', $userId)
->where('status', \app\admin\model\shopro\agent\Agent::STATUS_NORMAL)
->field('id,user_id,province_name,real_name,id_card,id_card_images,commission_rate,total_commission,status,apply_id,createtime')
->find();
if (!$agent) {
$this->error('数据不存在');
}
$this->success('成功', $agent);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment