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
da6eb1fd
Commit
da6eb1fd
authored
Dec 18, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑完后返回用户信息 增加 通过token获取用户信息
parent
4f7d210b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
24 deletions
+36
-24
Member.php
application/api/controller/Member.php
+14
-1
Basic.php
application/api/extend/Basic.php
+1
-1
Users.php
application/model/Users.php
+8
-17
route.php
application/route.php
+1
-0
user.css
public/resource/css/user.css
+2
-1
user.js
public/resource/js/user.js
+10
-4
No files found.
application/api/controller/Member.php
View file @
da6eb1fd
...
...
@@ -268,7 +268,7 @@ class Member extends Basic
$user_data
->
save
();
if
(
$user_data
->
id
)
{
$data
[
'data'
]
=
[
'id'
=>
$user_data
->
id
];
$data
[
'data'
]
=
$user_data
;
//编辑完返回用户信息
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
'修改成功'
;
}
else
{
...
...
@@ -364,4 +364,17 @@ class Member extends Basic
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 通过AuthToken获取用户信息编辑用
* @return type
*/
public
function
getUserInfo
()
{
$data
[
'status'
]
=
200
;
$fields
=
'user_nick,user_phone,user_pic,referrer_id,referrer_source,integral,create_time,last_login_time'
;
$data
[
'data'
]
=
$this
->
user
->
selectUser
(
$this
->
userId
,
$fields
);
$data
[
'msg'
]
=
''
;
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
application/api/extend/Basic.php
View file @
da6eb1fd
...
...
@@ -79,7 +79,7 @@ class Basic extends Controller
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
//过滤掉不需要验证token的接口
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
//
$this->tokenVerify();
$this
->
tokenVerify
();
}
}
...
...
application/model/Users.php
View file @
da6eb1fd
...
...
@@ -10,42 +10,33 @@ class Users extends Model
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_users'
;
public
function
add
()
{
}
public
function
selectUser
(
$userId
)
public
function
selectUser
(
$userId
,
$fields
=
'id,user_phone'
)
{
$param
[
"status"
]
=
array
(
"eq"
,
0
);
return
$this
->
field
(
"id,user_phone"
)
return
$this
->
field
(
$fields
)
->
where
(
$param
)
->
find
(
$userId
);
}
/**
* 查询经纪人
* 查询
用户和
经纪人
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $field
s
* @param type $params
* @param type $house_id 查询该街铺和商铺的经纪人
* @return type
*/
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$fields
=
'*'
,
$params
=
''
)
{
$result
=
$this
->
field
(
$fields
)
public
function
getUserAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$fields
=
'*'
,
$params
=
''
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.referrer_id = b.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
foreach
(
$result
as
$k
=>
$v
)
{
$data
[
$k
]
=
$v
->
toArray
();
}
return
$data
;
return
$result
;
}
}
application/route.php
View file @
da6eb1fd
...
...
@@ -78,6 +78,7 @@ Route::group('api', [
'logout'
=>
[
'api/member/logout'
,
[
'method'
=>
'get'
]
],
'inviteList/:id'
=>
[
'api/member/inviteList'
,
[
'method'
=>
'get'
]
],
//邀请记录
'qrCode'
=>
[
'api/member/qrCode'
,
[
'method'
=>
'get'
]
],
//邀请二维码
'getUserInfo'
=>
[
'api/member/getUserInfo'
,[
'method'
=>
'get'
]],
//通过AuthToken获取用户信息编辑用
//post member
...
...
public/resource/css/user.css
View file @
da6eb1fd
body
{
color
:
red
;
}
\ No newline at end of file
public/resource/js/user.js
View file @
da6eb1fd
define
([
'doT'
,
'text!temp/user_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/
user
.css'
,
"datetimepicker"
],
function
(
doT
,
template
)
{
define
([
'doT'
,
'text!temp/user_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/
home
.css'
,
"datetimepicker"
],
function
(
doT
,
template
)
{
var
user
=
{
urls
:
''
,
init
:
function
()
{
...
...
@@ -17,18 +17,24 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
},
event
:
function
()
{
$
(
".Bannertu"
).
click
(
function
()
{
alert
(
1111
);
BrowseServer
(
'cover_image'
);
});
$
(
"#search"
).
click
(
function
(){
alert
(
555
);
user
.
getList
(
1
);
});
},
getList
:
function
()
{
getList
:
function
(
pageNo
)
{
var
params
=
{};
params
.
company_user_name
=
$
(
"input[name=company_user_name]"
).
val
();
params
.
pageNo
=
pageNo
;
$
.
ajax
({
url
:
'/index/usersList'
,
type
:
'GET'
,
async
:
true
,
data
:
{},
data
:
{
params
},
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'user_list_tpl'
).
innerHTML
;
...
...
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