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
831d3747
Commit
831d3747
authored
Jan 30, 2018
by
zfc
Committed by
hujun
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人列表3
parent
5ea6ecbe
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
274 additions
and
28 deletions
+274
-28
Agent.php
application/index/controller/Agent.php
+13
-12
agent.html
application/index/view/agent/agent.html
+4
-4
save_agent.html
application/index/view/agent/save_agent.html
+167
-11
AAgents.php
application/model/AAgents.php
+12
-0
agent.js
public/resource/js/agent.js
+5
-1
save_agent.js
public/resource/js/save_agent.js
+73
-0
No files found.
application/index/controller/Agent.php
View file @
831d3747
...
@@ -47,7 +47,7 @@ class Agent extends Basic
...
@@ -47,7 +47,7 @@ class Agent extends Basic
}
}
//编辑页面
//编辑页面
public
function
updateAgent
(){
public
function
saveAgentIndex
(){
return
view
(
'save_agent'
);
return
view
(
'save_agent'
);
}
}
/*********************接口******************************/
/*********************接口******************************/
...
@@ -60,21 +60,22 @@ class Agent extends Basic
...
@@ -60,21 +60,22 @@ class Agent extends Basic
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//条件
//条件
$where
=
''
;
$where
=
'
a.status in(0,1)
'
;
$search
=
$params
[
'search'
];
$search
=
$params
[
'search'
];
// prt($data);
if
(
!
empty
(
$search
)){
if
(
!
empty
(
$search
)){
Session
::
set
(
"search.agent"
,
$search
);
$where
.=
" id='
$search
' or name like '%
$search
%' or phone like '%
$search
%' "
;
// Session::set("search.agent",$search);
$where
.=
" and a.id='
$search
' or a.name like '%
$search
%' or a.phone like '%
$search
%' "
;
$data
[
'search'
]
=
$search
;
$data
[
'search'
]
=
$search
;
}
else
{
}
else
{
$search
=
Session
::
get
(
"search.agent"
);
//
$search=Session::get("search.agent");
if
(
!
empty
(
$search
)){
//
if(!empty($search)){
$where
.=
" id='
$search
' or name like '%
$search
%' or phone like '%
$search
%' "
;
//
$where.=" id='$search' or name like '%$search%' or phone like '%$search%' ";
$data
[
'search'
]
=
$search
;
//
$data['search']=$search;
}
//
}
}
}
$where
=
'a.status in(0,1)'
;
$field
=
"a.id,a.store_id,a.district_id,a.`level`,a.`name`,a.phone,a.sex,a.img,a.`status`,a.inviter_id,a.create_time,
$field
=
"a.id,a.store_id,a.district_id,a.`level`,a.`name`,a.phone,a.sex,a.img,a.`status`,a.inviter_id,a.create_time,
ifnull(s.store_name,'')store_name,ifnull(d.district_name,'')district_name"
;
ifnull(s.store_name,'')store_name,ifnull(d.district_name,'')district_name"
;
$order
=
'a.id asc'
;
$order
=
'a.id asc'
;
...
@@ -83,7 +84,7 @@ class Agent extends Basic
...
@@ -83,7 +84,7 @@ class Agent extends Basic
[
'a_district d'
,
'a.district_id=d.id'
,
'left'
]
[
'a_district d'
,
'a.district_id=d.id'
,
'left'
]
];
];
$data
[
'list'
]
=
$table
->
getList
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'list'
]
=
$table
->
getList
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'total'
]
=
$table
->
getTotal
(
'status=1'
);
$data
[
'total'
]
=
$table
->
getTotal
2
(
$where
);
// prt($list);//转化arr
// prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr
//prt(collection($list)->toArray());//转化arr
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
...
...
application/index/view/agent/agent.html
View file @
831d3747
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
<div
class=
"col-xs-12 col-sm-12 button-list clearfix"
>
<div
class=
"col-xs-12 col-sm-12 button-list clearfix"
>
<!-- 工具栏按钮 -->
<!-- 工具栏按钮 -->
<!--<div class="form-group">-->
<!--<div class="form-group">-->
<a
title=
"新增"
class=
"btn btn-primary btn-sm"
href=
"/
admin.php/admin/user/edit.html
"
>
新增
</a>
<a
title=
"新增"
class=
"btn btn-primary btn-sm"
href=
"/
index/saveAgentIndex
"
>
新增
</a>
<a
title=
"删除"
target-form=
"ids"
class=
"btn btn-danger ajax-post confirm btn-sm"
model=
"User"
href=
"/admin.php/admin/user/setstatus/status/delete/model/User.html"
>
删除
</a>
<a
title=
"删除"
target-form=
"ids"
class=
"btn btn-danger ajax-post confirm btn-sm"
model=
"User"
href=
"/admin.php/admin/user/setstatus/status/delete/model/User.html"
>
删除
</a>
<
a
target-form=
"ids"
class=
"btn btn-info btn-raised btn-sm"
title=
"<i class="fa fa-comment-o"></i> 发送消息"
onclick=
"send_msg()"
><i
class=
"fa fa-comment-o"
></i>
发送消息
</a>
<
!--<a target-form="ids" class="btn btn-info btn-raised btn-sm" title="<i class="fa fa-comment-o"></i> 发送消息" onclick="send_msg()"><i class="fa fa-comment-o"></i> 发送消息</a> -->
<a
target-form=
"ids"
class=
"btn btn-info btn-sm"
title=
"<i class="fa fa-users"></i> 变更角色"
onclick=
"role_move()"
><i
class=
"fa fa-users"
></i>
变更角色
</a>
<a
target-form=
"ids"
class=
"btn btn-info btn-sm"
title=
"<i class="fa fa-users"></i> 变更角色"
onclick=
"role_move()"
><i
class=
"fa fa-users"
></i>
变更角色
</a>
<!-- </div>-->
<!-- </div>-->
<!-- 搜索框 -->
<!-- 搜索框 -->
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
<form
class=
"form form-inline"
method=
"get"
action=
"/admin.php/admin/user/index.html"
>
<form
class=
"form form-inline"
method=
"get"
action=
"/admin.php/admin/user/index.html"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"input-group search-form"
>
<div
class=
"input-group search-form"
>
<input
type=
"text"
name=
"
keyword
"
class=
"form-control search-input pull-right"
value=
""
placeholder=
"请输入ID/用户名/昵称"
>
<input
type=
"text"
name=
"
search
"
class=
"form-control search-input pull-right"
value=
""
placeholder=
"请输入ID/用户名/昵称"
>
<span
class=
"input-group-btn"
><button
type=
"button"
class=
"btn btn-success search-btn"
><i
class=
"glyphicon glyphicon-search"
></i></button></span>
<span
class=
"input-group-btn"
><button
id=
"search"
type=
"button"
class=
"btn btn-success search-btn"
><i
class=
"glyphicon glyphicon-search"
></i></button></span>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
application/index/view/agent/save_agent.html
View file @
831d3747
<!DOCTYPE html>
{layout name="global/frame_tpl" /}
<html
lang=
"en"
>
<input
type=
"hidden"
class=
"page-load"
id=
"save_agent"
/>
<!--关联js文件-->
<head>
<meta
charset=
"UTF-8"
>
<input
type=
"hidden"
name=
"id"
value=
""
/>
<title>
Title
</title>
<div
class=
"col-md-11"
style=
"min-height: 1426px; width: 1035px; float: left; margin-left: 20px;"
>
</head>
<form
action=
"http://me.tp.com/admin.php/admin/user/edit.html?_pjax=%23pjax-container"
method=
"post"
class=
"form-builder form-horizontal"
>
<body>
<fieldset>
</body>
</html>
\ No newline at end of file
<div
class=
"form-group item_username "
>
<label
class=
"col-md-2 control-label"
><sup>
*
</sup>
用户名
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
class=
"form-control"
name=
"name"
value=
""
>
</div>
<div
class=
"col-md-5 help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
登录账户所用名称
</div></div>
<div
class=
"form-group item_password "
>
<label
class=
"col-md-2 control-label"
>
密码
</label>
<div
class=
"col-md-4"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-expeditedssl"
></i></span>
<input
type=
"password"
class=
"form-control"
name=
"password"
value=
""
placeholder=
"留空则为手机号后6位"
>
</div>
</div>
</div>
<div
class=
"form-group item_email "
>
<label
class=
"col-md-2 control-label"
><sup>
*
</sup>
门店ID
</label>
<div
class=
"col-md-4"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-envelope"
></i></span>
<input
type=
"email"
class=
"form-control"
name=
"email"
value=
""
placeholder=
"填写门店ID"
>
</div>
</div>
</div>
<div
class=
"form-group item_mobile "
>
<label
class=
"col-md-2 control-label"
>
手机号
</label>
<div
class=
"col-md-4"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-phone"
></i></span>
<input
type=
"number"
class=
"form-control"
name=
"mobile"
value=
""
placeholder=
"填写手机号"
>
</div>
</div>
</div>
<!--
如果选项的值是自定义数组(必须定义key为title的元素)需要解析,如果选项的值是常规字符串直接显示
此处主要是用来给option定义更多的属性,比如data-ia=1,那么option应为
$option = array('title' => 标题, 'data-id' => 1);
-->
<div
class=
"form-group item_sex "
>
<label
class=
"col-md-2 control-label"
>
性别
</label>
<div
class=
"col-md-8"
>
<div
class=
"oh mb-10 pl-5"
>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"sex"
id=
"sex0"
value=
"0"
>
</div>
保密
</label>
</div>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"sex"
id=
"sex1"
value=
"1"
>
</div>
男
</label>
</div>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"sex"
id=
"sex2"
value=
"2"
>
</div>
女
</label>
</div>
</div>
</div>
</div>
<div
class=
"form-group item_sex "
>
<label
class=
"col-md-2 control-label"
>
级别
</label>
<div
class=
"col-md-8"
>
<div
class=
"oh mb-10 pl-5"
>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"level"
id=
"level10"
value=
"10"
>
</div>
业务员
</label>
</div>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"level"
id=
"level20"
value=
"20"
>
</div>
店长
</label>
</div>
<div
class=
"radio radio-primary fl mr-10"
>
<label
for=
"sex0"
class=
"radio-label1"
>
<div
class=
"iradio_minimal-blue"
aria-checked=
"false"
aria-disabled=
"false"
style=
""
>
<input
type=
"radio"
name=
"level"
id=
"level30"
value=
"30"
>
</div>
总监
</label>
</div>
</div>
</div>
</div>
<div
class=
"form-group item_allow_admin "
>
<label
for=
"allow_admin"
class=
"col-md-2 control-label"
>
是否允许访问后台
</label>
<div
class=
"col-md-4"
>
<select
name=
"allow_admin"
id=
"allow_admin"
class=
"form-control"
>
<option
value=
""
>
请选择
</option>
<option
value=
"0"
>
不允许
</option>
<option
value=
"1"
>
允许
</option>
</select>
</div>
</div>
<div
class=
"form-group item_description "
>
<label
class=
"col-md-2 control-label"
>
个人说明
</label>
<div
class=
"col-md-6"
>
<textarea
name=
"description"
class=
"form-control"
length=
"120"
rows=
"5"
></textarea>
<p
class=
"help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
请填写个人说明
</p>
</div>
</div>
<div
class=
"form-group item_status "
>
<label
for=
"status"
class=
"col-md-2 control-label"
>
状态
</label>
<div
class=
"col-md-4"
>
<select
name=
"status"
id=
"status"
class=
"form-control"
>
<option
value=
""
>
请选择
</option>
<option
value=
"0"
>
禁用
</option>
<option
value=
"1"
selected=
""
>
正常
</option>
<option
value=
"2"
>
待验证
</option>
</select>
</div>
</div>
<hr>
<div
class=
"form-group"
>
<div
class=
"col-md-10 col-xs-offset-2 mt-10 tc"
>
<div
class=
"col-md-3 col-xs-6"
>
<a
class=
"btn btn-block btn-primary submit ajax-post "
id=
"submit"
>
确定
</a>
</div>
<div
class=
"col-md-3 col-xs-6"
>
<button
onclick=
"javascript:history.back(-1);return false;"
class=
"btn btn-block btn-default return"
>
返回
</button>
</div>
</div>
</div>
</fieldset>
</form>
</div>
\ No newline at end of file
application/model/AAgents.php
View file @
831d3747
...
@@ -71,4 +71,15 @@ public function saveList(){
...
@@ -71,4 +71,15 @@ public function saveList(){
return
$r
;
return
$r
;
}
}
/**
* 记录总数
*
* @param $params
* @return int|string
*/
public
function
getTotal2
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
}
}
}
\ No newline at end of file
public/resource/js/agent.js
View file @
831d3747
define
([
'doT'
,
'text!temp/agent_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
define
([
'doT'
,
'text!temp/agent_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
agent
=
{
var
agent
=
{
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
15
,
pageSize
:
15
,
init
:
function
()
{
init
:
function
()
{
...
@@ -9,6 +9,9 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
...
@@ -9,6 +9,9 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
agent
.
event
();
agent
.
event
();
},
},
event
:
function
()
{
event
:
function
()
{
$
(
'#search'
).
click
(
function
(
pageNo
)
{
agent
.
getList
(
1
);
});
},
},
getList
:
function
(
pageNo
){
getList
:
function
(
pageNo
){
...
@@ -16,6 +19,7 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
...
@@ -16,6 +19,7 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
var
params
=
{};
var
params
=
{};
params
.
pageNo
=
agent
.
pageNo
;
params
.
pageNo
=
agent
.
pageNo
;
params
.
pageSize
=
agent
.
pageSize
;
params
.
pageSize
=
agent
.
pageSize
;
params
.
search
=
$
(
"input[name='search']"
).
val
();
$
.
ajax
({
$
.
ajax
({
url
:
'/index/AgentList.html'
,
url
:
'/index/AgentList.html'
,
type
:
'GET'
,
type
:
'GET'
,
...
...
public/resource/js/save_agent.js
View file @
831d3747
define
([
'doT'
,
''
,
'css!style/home.css'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
aagent
=
{
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
aagent
.
getList
();
aagent
.
event
();
},
event
:
function
()
{
$
(
"#submit"
).
click
(
function
()
{
var
par
=
{}
par
.
id
=
$
(
"input[name = id]"
).
val
();
par
.
name
=
$
(
"input[name = name]"
).
val
();
par
.
password
=
$
(
"input[name = password]"
).
val
();
par
.
sort
=
$
(
"input[name = sort]"
).
val
();
par
.
pid
=
$
(
"#pid"
).
val
();
par
.
is_menu
=
$
(
"input[name =is_menu]:checked"
).
val
();
$
.
ajax
({
url
:
'/index/saveAgent'
,
data
:
par
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
alert
(
data
.
msg
);
console
.
log
(
data
);
}
});
})
},
getList
:
function
(){
$
.
ajax
({
url
:
'/index/classList/type/1'
,
type
:
'GET'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'auth_class_tpl'
).
innerHTML
;
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#pid"
).
html
(
doTempl
(
data
.
data
));
//赋值
}
});
var
id
=
getUrlParam
(
'id'
);
$
.
ajax
({
url
:
'/index/updateAuthRule/group_id/'
+
id
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"input[name = id]"
).
val
(
data
.
data
.
id
);
$
(
"input[name = title]"
).
val
(
data
.
data
.
title
);
$
(
"input[name = name]"
).
val
(
data
.
data
.
name
);
$
(
"input[name = sort]"
).
val
(
data
.
data
.
sort
);
$
(
"#pid"
).
val
(
data
.
data
.
pid
);
if
(
data
.
data
.
is_menu
==
0
){
$
(
"#is_menu2"
).
attr
(
'checked'
,
true
);
}
else
{
$
(
"#is_menu1"
).
attr
(
'checked'
,
true
);
}
}
})
}
}
return
aagent
;
});
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