Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
29cbccfb
Commit
29cbccfb
authored
Nov 29, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表情问题
parent
fb1c65ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
application/api/controller/User.php
+1
-2
application/common/model/BaseModel.php
+1
-0
application/common/model/User.php
+23
-0
application/database.php
+1
-1
No files found.
application/api/controller/User.php
View file @
29cbccfb
...
...
@@ -75,7 +75,7 @@ class User extends Base
//第一次注册
$user
=
new
UserModel
;
$user
->
openid
=
$data
->
openId
;
$user
->
nickname
=
$data
->
nickName
;
;
$user
->
nickname
=
$data
->
nickName
;
// 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
$user
->
gender
=
intval
(
$data
->
gender
);
$user
->
avatar
=
$data
->
avatarUrl
;
...
...
@@ -135,7 +135,6 @@ class User extends Base
include_once
VENDOR_PATH
.
'aesphp/wxBizDataCrypt.php'
;
$pc
=
new
\WXBizDataCrypt
(
$appId
,
$session_key
);
$errCode
=
$pc
->
decryptData
(
$encryptedData
,
$iv
,
$data
);
if
(
$errCode
==
0
)
{
$data
=
json_decode
(
$data
);
$phone
=
$data
->
purePhoneNumber
;
...
...
application/common/model/BaseModel.php
View file @
29cbccfb
...
...
@@ -20,5 +20,6 @@ class BaseModel extends Model
//隐藏字段
protected
$hidden
=
[
'updated_at'
,
'deleted_time'
];
}
?>
application/common/model/User.php
View file @
29cbccfb
...
...
@@ -41,4 +41,26 @@ class User extends BaseModel
return
$this
->
belongsToMany
(
'Project'
,
'user_collections'
,
'pid'
,
'uid'
)
->
order
(
'pivot.id'
,
'desc'
);
}
// public function getNicknameAttr($v)
// {
// if($this->is_base64($v)){
// return base64_decode($v);
// }
// return $v;
// }
//
// public function setNicknameAttr($v)
// {
// return base64_encode($v);
// }
//
// public function is_base64($str){
// if($str==base64_encode(base64_decode($str))){
// return true;
// }else{
// return false;
// }
// }
}
\ No newline at end of file
application/database.php
View file @
29cbccfb
...
...
@@ -27,7 +27,7 @@ $config = [
// 数据库连接参数
'params'
=>
[],
// 数据库编码默认采用utf8
'charset'
=>
'utf8
mb4
'
,
'charset'
=>
'utf8'
,
// 数据库表前缀
'prefix'
=>
'mr_'
,
// 数据库调试模式
...
...
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