Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
94d60b51
Commit
94d60b51
authored
Apr 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户注册并发处理
parent
363e1365
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
Member.php
application/api/controller/Member.php
+4
-1
Users.php
application/model/Users.php
+26
-0
No files found.
application/api/controller/Member.php
View file @
94d60b51
...
@@ -217,8 +217,9 @@ class Member extends Basic
...
@@ -217,8 +217,9 @@ class Member extends Basic
$data
[
'status'
]
=
101
;
$data
[
'status'
]
=
101
;
$data
[
'data'
]
=
array
();
$data
[
'data'
]
=
array
();
$this
->
user
->
startTrans
();
if
(
$phone
)
{
if
(
$phone
)
{
$user_data
=
$this
->
user
->
get
([
'user_phone'
=>
$phone
]
);
$user_data
=
$this
->
user
->
findUserByPhone
(
'*'
,
$phone
,
true
);
}
else
{
}
else
{
$user_data
=
$this
->
user
->
get
(
$this
->
userId
);
$user_data
=
$this
->
user
->
get
(
$this
->
userId
);
}
}
...
@@ -304,9 +305,11 @@ class Member extends Basic
...
@@ -304,9 +305,11 @@ class Member extends Basic
}
}
if
(
empty
(
$id
))
{
if
(
empty
(
$id
))
{
$this
->
user
->
rollback
();
$data
[
'status'
]
=
101
;
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'注册失败'
;
$data
[
'msg'
]
=
'注册失败'
;
}
else
{
}
else
{
$this
->
user
->
commit
();
$jwt_data
[
'id'
]
=
$id
;
$jwt_data
[
'id'
]
=
$id
;
$jwt_data
[
'userNick'
]
=
$insert_data
[
'user_nick'
];
$jwt_data
[
'userNick'
]
=
$insert_data
[
'user_nick'
];
$jwt_data
[
'phone'
]
=
$insert_data
[
'user_phone'
];
$jwt_data
[
'phone'
]
=
$insert_data
[
'user_phone'
];
...
...
application/model/Users.php
View file @
94d60b51
...
@@ -428,4 +428,30 @@ class Users extends Model
...
@@ -428,4 +428,30 @@ class Users extends Model
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
}
}
/**
* 跟进用户手机号查询信息
*
* @param string $field
* @param $phone
* @param bool $lock
* @return $this|array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
findUserByPhone
(
$field
=
'*'
,
$phone
,
$lock
=
false
)
{
if
(
$lock
)
{
$data
=
$this
->
field
(
$field
)
->
where
(
'user_phone'
,
$phone
)
->
lock
(
true
)
->
find
();
}
else
{
$data
=
$this
->
field
(
$field
)
->
where
(
'user_phone'
,
$phone
)
->
find
();
}
return
$data
;
}
}
}
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