Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
7c9a426b
Commit
7c9a426b
authored
Jun 29, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新代理商申请接口地址
parent
a9df1ab5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
30 deletions
+43
-30
Agent.php
addons/shopro/controller/user/Agent.php
+43
-0
User.php
addons/shopro/controller/user/User.php
+0
-30
No files found.
addons/shopro/controller/user/Agent.php
0 → 100644
View file @
7c9a426b
<?php
namespace
addons\shopro\controller\user
;
use
addons\shopro\controller\Common
;
class
Agent
extends
Common
{
protected
$noNeedLogin
=
[];
protected
$noNeedRight
=
[
'*'
];
/**
* 申请成为代理商
* POST /addons/shopro/user.agent/agentapply
*/
public
function
agentapply
()
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
''
);
}
$user
=
auth_user
();
$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'
]);
custom_log
(
'[agent.apply] 解析参数: '
.
json_encode
(
$params
,
JSON_UNESCAPED_UNICODE
),
$userId
,
'share'
);
$this
->
svalidate
(
$params
,
'\addons\shopro\validate\user\User.agentApply'
);
custom_log
(
'[agent.apply] 参数校验通过'
,
$userId
,
'share'
);
$service
=
new
\addons\shopro\service\agent\ApplyService
(
$user
);
try
{
$apply
=
$service
->
submit
(
$params
);
custom_log
(
'[agent.apply] 代理申请成功, apply_id='
.
(
$apply
->
id
??
''
),
$userId
,
'share'
);
$this
->
success
(
'申请已提交,请等待审核'
,
$apply
);
}
catch
(
\think\Exception
$e
)
{
custom_log
(
'[agent.apply] 代理申请失败: '
.
$e
->
getMessage
(),
$userId
,
'share'
,
'warning'
);
$this
->
error
(
$e
->
getMessage
());
}
}
}
addons/shopro/controller/user/User.php
View file @
7c9a426b
...
@@ -398,36 +398,6 @@ class User extends Common
...
@@ -398,36 +398,6 @@ class User extends Common
}
}
/**
/**
* 申请成为代理商
*/
public
function
agentapply
()
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
''
);
}
$user
=
auth_user
();
$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'
]);
custom_log
(
'[agent.apply] 解析参数: '
.
json_encode
(
$params
,
JSON_UNESCAPED_UNICODE
),
$userId
,
'share'
);
$this
->
svalidate
(
$params
,
'.agentApply'
);
custom_log
(
'[agent.apply] 参数校验通过'
,
$userId
,
'share'
);
$service
=
new
\addons\shopro\service\agent\ApplyService
(
$user
);
try
{
$apply
=
$service
->
submit
(
$params
);
custom_log
(
'[agent.apply] 代理申请成功, apply_id='
.
(
$apply
->
id
??
''
),
$userId
,
'share'
);
$this
->
success
(
'申请已提交,请等待审核'
,
$apply
);
}
catch
(
\think\Exception
$e
)
{
custom_log
(
'[agent.apply] 代理申请失败: '
.
$e
->
getMessage
(),
$userId
,
'share'
,
'warning'
);
$this
->
error
(
$e
->
getMessage
());
}
}
/**
* 用户注销
* 用户注销
* 物理删除用户,且未做业务上的逻辑判断,慎用
* 物理删除用户,且未做业务上的逻辑判断,慎用
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment