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
906c19a3
Commit
906c19a3
authored
Dec 18, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台用户列表
parent
8ee73598
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
47 deletions
+82
-47
Member.php
application/index/controller/Member.php
+27
-14
Index.php
application/index/controller/member/Index.php
+1
-1
navigation.html
application/index/view/global/navigation.html
+1
-1
users_list.html
application/index/view/member/users_list.html
+6
-14
Users.php
application/model/Users.php
+16
-1
route.php
application/route.php
+1
-1
user.js
public/resource/js/user.js
+23
-8
user_template_tpl.html
public/resource/template/user_template_tpl.html
+7
-7
No files found.
application/index/controller/Member.php
View file @
906c19a3
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\Users
;
use
app\model\Users
;
use
think\Response
;
/**
/**
* Description of Member
* Description of Member
*
*
...
@@ -13,26 +15,37 @@ use app\model\Users;
...
@@ -13,26 +15,37 @@ use app\model\Users;
class
Member
extends
Basic
{
class
Member
extends
Basic
{
public
function
index
()
{
public
function
index
()
{
return
view
(
'member/users_list'
);
return
view
(
'member/consumer_list'
);
}
}
public
function
getUserList
()
{
public
function
getUserList
(
Response
$request
)
{
$params
=
$this
->
params
;
$data
[
'status'
]
=
200
;
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
array
();
$data
[
'msg'
]
=
''
;
$data
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$_GET
[
'pageNo'
])
?
1
:
$_GET
[
'pageNo'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$_GET
[
'pageSize'
])
?
15
:
$_GET
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where
[
'status'
]
=
0
;
if
(
$_GET
[
'name'
])
{
$where
[
'a.user_nick'
]
=
$_GET
[
'name'
];
}
if
(
$_GET
[
'phone'
])
{
$where
[
'a.user_phone'
]
=
$_GET
[
'phone'
];
}
if
(
$_GET
[
'invite'
])
{
$where
[
'b.phone'
]
=
$_GET
[
'invite'
];
}
$user
=
new
Users
();
$user
=
new
Users
();
$fields
=
'*'
;
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,b.realname'
;
$data
[
'data'
]
=
$user
->
getUser
(
$pageNo
,
$pageSize
,
''
,
$fields
,
'status = 0'
);
$data
[
'list'
]
=
$user
->
getUserAgent
(
$pageNo
,
$pageSize
,
''
,
$fields
,
$where
);
$data
[
'data'
][
'pageNo'
]
=
$pageNo
;
$data
[
'total'
]
=
$user
->
getUserAgentTotal
(
$where
);
$data
[
'data'
][
'pageSize'
]
=
$pageSize
;
$data
[
'pageNo'
]
=
$pageNo
;
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]
);
$data
[
'pageSize'
]
=
$pageSize
;
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
}
}
}
}
application/index/controller/member/Index.php
View file @
906c19a3
...
@@ -30,7 +30,7 @@ class Index
...
@@ -30,7 +30,7 @@ class Index
public
function
consumer_list
()
public
function
consumer_list
()
{
{
return
view
(
'member/
consumer
_list'
);
return
view
(
'member/
users
_list'
);
//$this->response('100',array(),'json');
//$this->response('100',array(),'json');
}
}
...
...
application/index/view/global/navigation.html
View file @
906c19a3
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<a
href=
"entrust_list.html"
>
委托转铺列表
</a>
<a
href=
"entrust_list.html"
>
委托转铺列表
</a>
</li>
</li>
<li
role=
"presentation"
class=
"active"
>
<li
role=
"presentation"
class=
"active"
>
<a
href=
"
consumer
_list.html"
>
用户列表
</a>
<a
href=
"
users
_list.html"
>
用户列表
</a>
</li>
</li>
<li
role=
"presentation"
class=
"active"
>
<li
role=
"presentation"
class=
"active"
>
<a
href=
"diagram_list.html"
>
首页轮播图
</a>
<a
href=
"diagram_list.html"
>
首页轮播图
</a>
...
...
application/index/view/member/
consumer
_list.html
→
application/index/view/member/
users
_list.html
View file @
906c19a3
...
@@ -31,10 +31,10 @@
...
@@ -31,10 +31,10 @@
<tr>
<tr>
<td
colspan=
"6"
>
<td
colspan=
"6"
>
<form
action=
""
method=
"get"
id=
"form_search"
>
<form
action=
""
method=
"get"
id=
"form_search"
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"company_name"
name=
"
company_user_
name"
placeholder=
"姓名"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"company_name"
name=
"name"
placeholder=
"姓名"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"mobile"
name=
"
mobil
e"
placeholder=
"手机号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"mobile"
name=
"
phon
e"
placeholder=
"手机号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"invitemobile"
name=
"
mobil
e"
placeholder=
"邀请人手机号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"invitemobile"
name=
"
invit
e"
placeholder=
"邀请人手机号"
type=
"text"
value=
""
>
<span
class=
"btn btn-default btn3"
onclick=
"search()
"
>
搜索
</span>
<span
class=
"btn btn-default btn3"
id=
"search
"
>
搜索
</span>
<span
class=
"btn btn-default btn3"
onclick=
"search_reset()"
>
重置
</span>
<span
class=
"btn btn-default btn3"
onclick=
"search_reset()"
>
重置
</span>
</form>
</form>
...
@@ -103,16 +103,8 @@
...
@@ -103,16 +103,8 @@
</table>
</table>
</div>
</div>
<!-- /#page-content-wrapper -->
<!-- /#page-content-wrapper -->
<div
class=
"page-cla"
>
<div
style=
"float:right"
id=
"pagediv"
>
<ul
class=
"pagination"
>
<li><a
href=
"#"
>
«
</a></li>
<li><a
href=
"#"
>
1
</a></li>
<li><a
href=
"#"
>
2
</a></li>
<li><a
href=
"#"
>
3
</a></li>
<li><a
href=
"#"
>
4
</a></li>
<li><a
href=
"#"
>
5
</a></li>
<li><a
href=
"#"
>
»
</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
application/model/Users.php
View file @
906c19a3
...
@@ -36,7 +36,22 @@ class Users extends Model
...
@@ -36,7 +36,22 @@ class Users extends Model
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
return
$result
;
return
$result
;
}
}
/**
* 获取查询用户和经纪人总数
*
* @param $params
* @return mixed
*/
public
function
getUserAgentTotal
(
$params
)
{
$result
=
$this
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.referrer_id = b.id'
,
'left'
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
}
application/route.php
View file @
906c19a3
...
@@ -57,7 +57,7 @@ Route::group('index', [
...
@@ -57,7 +57,7 @@ Route::group('index', [
'banner'
=>
[
'index/banner/index'
,
[
'method'
=>
'get'
]
],
'banner'
=>
[
'index/banner/index'
,
[
'method'
=>
'get'
]
],
'bannerList'
=>
[
'index/banner/getBannerList'
,
[
'method'
=>
'post'
]
],
'bannerList'
=>
[
'index/banner/getBannerList'
,
[
'method'
=>
'post'
]
],
'usersList'
=>
[
'index/member/getUserList'
,[
'method'
=>
'get'
]],
'usersList'
=>
[
'index/member/getUserList'
,[
'method'
=>
'get'
]],
'user'
=>
[
'index/member/index'
]
'user
s_list
'
=>
[
'index/member/index'
]
]);
]);
...
...
public/resource/js/user.js
View file @
906c19a3
define
([
'doT'
,
'text!temp/user_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/home.css'
,
"datetimepicker"
],
function
(
doT
,
template
)
{
define
([
'doT'
,
'text!temp/user_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/home.css'
,
"datetimepicker"
,
'pagination'
],
function
(
doT
,
template
)
{
var
user
=
{
var
user
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
3
,
/*每页显示多少条*/
urls
:
''
,
urls
:
''
,
init
:
function
()
{
init
:
function
()
{
//初始化dot
//初始化dot
...
@@ -20,27 +23,39 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -20,27 +23,39 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
BrowseServer
(
'cover_image'
);
BrowseServer
(
'cover_image'
);
});
});
$
(
"#search"
).
click
(
function
(){
$
(
"#search"
).
click
(
function
(){
alert
(
555
);
user
.
getList
(
1
);
user
.
getList
(
1
);
});
});
},
},
getList
:
function
(
pageNo
)
{
getList
:
function
(
pageNo
)
{
user
.
pageNo
=
pageNo
;
var
params
=
{};
var
params
=
{};
params
.
company_user_name
=
$
(
"input[name=company_user_name]"
).
val
();
params
.
name
=
$
(
"input[name='name']"
).
val
();
params
.
pageNo
=
pageNo
;
params
.
phone
=
$
(
"input[name='phone']"
).
val
();
params
.
invite
=
$
(
"input[name='invite']"
).
val
();
params
.
pageNo
=
user
.
pageNo
;
params
.
pageSize
=
user
.
pageSize
;
console
.
log
(
name
)
$
.
ajax
({
$
.
ajax
({
url
:
'/index/usersList'
,
url
:
'/index/usersList'
,
type
:
'GET'
,
type
:
'GET'
,
async
:
true
,
async
:
true
,
data
:
{
params
}
,
data
:
params
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'user_list_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'user_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#users_list"
).
append
(
doTtmpl
(
data
));
$
(
"#users_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
/*分页代码*/
$
(
"#pagediv"
).
pagination
({
length
:
data
.
data
.
total
,
current
:
pageNo
,
every
:
user
.
pageSize
,
onClick
:
function
(
el
)
{
user
.
getList
(
el
.
num
.
current
);
}
});
}
}
});
});
}
}
...
...
public/resource/template/user_template_tpl.html
View file @
906c19a3
<script
id=
"user_list_tpl"
type=
"text/template"
>
<script
id=
"user_list_tpl"
type=
"text/template"
>
[
%
if
(
it
.
data
)
{
%
]
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
.
data
){
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
>
<
tr
>
<
td
>
[
%=
it
.
data
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
.
data
[
item
][
"id"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"id"
]
%
]
<
/td
>
<
td
>
[
%=
it
.
data
[
item
][
"user_nick"
]
%
][
%=
it
.
data
[
item
][
"user_pic"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"user_nick"
]
%
][
%=
it
[
item
][
"user_pic"
]
%
]
<
/td
>
<
td
>
[
%=
it
.
data
[
item
][
"user_phone"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"user_phone"
]
%
]
<
/td
>
<
td
>
[
%=
it
.
data
[
item
][
"realname"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"realname"
]
%
]
<
/td
>
<
td
>
<
td
>
<
a
class
=
"btn1 btn-success "
href
=
"#modal-do"
data
-
toggle
=
"modal"
>
<
a
class
=
"btn1 btn-success "
href
=
"#modal-do"
data
-
toggle
=
"modal"
>
编辑
编辑
...
...
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