Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
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
bp
goods
Commits
81cf91df
Commit
81cf91df
authored
Sep 03, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into fix_luhongguang_20210902
parents
eaec0f3e
e640593a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
7 deletions
+21
-7
UserException.php
application/exception/custom/UserException.php
+1
-0
UserWechatBind.php
application/models/user/mysql/UserWechatBind.php
+9
-1
UserService.php
application/services/user/UserService.php
+9
-4
application.ini
conf/application.ini
+1
-1
cli.ini
conf/cli.ini
+1
-1
No files found.
application/exception/custom/UserException.php
View file @
81cf91df
...
...
@@ -22,5 +22,6 @@ class UserException extends BaseException
8
=>
'绑定手机号失败'
,
9
=>
'该手机号已绑定其他用户不能重复绑定'
,
10
=>
'mysql 异常'
,
11
=>
'头像昵称更新失败'
,
];
}
\ No newline at end of file
application/models/user/mysql/UserWechatBind.php
View file @
81cf91df
...
...
@@ -26,6 +26,14 @@ class UserWechatBind extends MysqlBase
return
self
::
get
(
$columns
,
$where
);
}
public
static
function
getRecordMaster
(
$where
,
$columns
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
getMaster
(
$columns
,
$where
);
}
public
static
function
getRecords
(
$where
,
$columns
=
[])
{
if
(
empty
(
$columns
))
{
...
...
@@ -34,7 +42,7 @@ class UserWechatBind extends MysqlBase
return
self
::
select
(
$columns
,
$where
);
}
public
static
function
getRecord
Master
(
$where
,
$columns
=
[])
public
static
function
getRecord
sMaster
(
$where
,
$columns
=
[])
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
...
...
application/services/user/UserService.php
View file @
81cf91df
...
...
@@ -58,7 +58,7 @@ class UserService
//}
$user
=
UserWechatBind
::
getRecord
([
'openid'
=>
$openid
]);
$user
=
UserWechatBind
::
getRecord
Master
([
'openid'
=>
$openid
]);
//如果系统不存在,用户信息,则注册新用户
if
(
empty
(
$user
)
&&
!
empty
(
$response
))
{
$insert
=
[
...
...
@@ -211,10 +211,15 @@ class UserService
"city"
=>
!
empty
(
$params
[
'city'
])
?
$params
[
'city'
]
:
''
,
"language"
=>
!
empty
(
$params
[
'language'
])
?
$params
[
'language'
]
:
''
,
];
$bindStatus
=
UserWechatBind
::
save
(
$update
,[
'openid'
=>
$params
[
'openid'
]]);
$user
=
UserWechatBind
::
getRecordMaster
([
'openid'
=>
$params
[
'openid'
]]);
if
(
empty
(
$user
)){
$update
[
'openid'
]
=
$params
[
'openid'
];
$bindStatus
=
UserWechatBind
::
save
(
$update
);
}
else
{
$bindStatus
=
UserWechatBind
::
save
(
$update
,[
'openid'
=>
$params
[
'openid'
]]);
}
if
(
!
$bindStatus
)
{
throw
new
UserException
([
'cus'
=>
8
]);
throw
new
UserException
([
'cus'
=>
11
]);
}
return
$update
;
}
...
...
conf/application.ini
View file @
81cf91df
...
...
@@ -31,6 +31,6 @@ exception.sys.msg = "系统未定义异常,研发正在赶来的路上..."
[prod : common : exception]
[p
re
: common : exception]
[p
erf
: common : exception]
[test : common : exception]
[dev : common : exception]
\ No newline at end of file
conf/cli.ini
View file @
81cf91df
...
...
@@ -11,6 +11,6 @@ idgen.partner = "bp"
idgen.key
=
"5cfdb867e96374c7883b31d6928cc4cb"
[prod : common]
[p
re
: common ]
[p
erf
: common ]
[test: common ]
[dev : common ]
\ No newline at end of file
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