Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
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
wangtao
projecttwo
Commits
a003f04a
Commit
a003f04a
authored
Jul 02, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机号重复提示
parent
30fb9f1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
User.php
app/api/controller/User.php
+22
-7
Project.php
app/model/Project.php
+2
-2
No files found.
app/api/controller/User.php
View file @
a003f04a
...
...
@@ -56,9 +56,14 @@ class User extends BaseController
}
$data
=
$request
->
param
();
$is_exit
=
userModel
::
where
([
'mobile'
=>
$data
[
'mobile'
]])
->
where
(
'is_del'
,
0
)
->
count
();
if
(
$is_exit
)
{
return
$this
->
returnMsg
(
'用户已存在'
,
0
);
$userRole
=
userModel
::
where
([
'mobile'
=>
$data
[
'mobile'
]])
->
where
(
'is_del'
,
0
)
->
value
(
'role'
);
if
(
$userRole
)
{
return
match
((
int
)
$userRole
)
{
1
=>
$this
->
returnMsg
(
'当前手机号已注册成普通用户'
),
2
=>
$this
->
returnMsg
(
'当前手机号已注册成企业用户'
),
3
=>
$this
->
returnMsg
(
'当前手机号已注册成高校用户'
),
default
=>
$this
->
returnMsg
(
'当前手机号已存在'
),
};
}
//只有普通用户验证验证码
...
...
@@ -287,12 +292,22 @@ class User extends BaseController
}
$data
=
$request
->
param
();
$count
=
userModel
::
where
([
'mobile'
=>
$data
[
'mobile'
]])
->
count
();
if
(
$count
>
0
)
{
return
$this
->
returnMsg
(
'手机号已存在'
);
$userRole
=
userModel
::
where
([
'mobile'
=>
$data
[
'mobile'
]])
->
where
(
'is_del'
,
0
)
->
value
(
'role'
);
if
(
!
$userRole
)
{
return
$this
->
returnMsg
(
'success'
,
1
);
}
return
$this
->
returnMsg
(
'success'
,
1
);
return
match
((
int
)
$userRole
)
{
1
=>
$this
->
returnMsg
(
'当前手机号已注册成普通用户'
),
2
=>
$this
->
returnMsg
(
'当前手机号已注册成企业用户'
),
3
=>
$this
->
returnMsg
(
'当前手机号已注册成高校用户'
),
default
=>
$this
->
returnMsg
(
'当前手机号已存在'
),
};
}
...
...
app/model/Project.php
View file @
a003f04a
...
...
@@ -72,7 +72,7 @@ class Project extends Model
public
function
getuserdata
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
)
->
field
(
'username,mobile,id'
);
->
field
(
'username,mobile,id
,headico
'
);
}
public
function
getShStatusTextAttr
(
$value
,
$data
)
...
...
@@ -191,7 +191,7 @@ class Project extends Model
}
$list
=
$query
->
field
(
'id,sn,title,createtime,cate_id,yusuan,zhouqi,tag_ids,put_end_time,thumb,user_id'
)
->
with
([
'thumb'
,
'getuserdata'
])
->
with
([
'thumb'
,
'getuserdata'
=>
[
'headico'
]
])
->
paginate
([
'page'
=>
$page
,
'list_rows'
=>
$pageSize
...
...
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