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
cc2e279b
Commit
cc2e279b
authored
May 15, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增经纪人重写
parent
2c481061
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
77 deletions
+67
-77
Agent.php
application/index/controller/Agent.php
+29
-13
agent.html
application/index/view/agent/agent.html
+37
-41
AAgents.php
application/model/AAgents.php
+0
-22
agent.js
public/resource/js/agent.js
+0
-0
agent_template_tpl.html
public/resource/template/agent_template_tpl.html
+1
-1
No files found.
application/index/controller/Agent.php
View file @
cc2e279b
...
...
@@ -116,42 +116,58 @@ class Agent extends Basic
* @throws \think\exception\DbException
*/
public
function
saveAgent
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$
table
=
new
AAgents
();
$
m_agent
=
new
AAgents
();
if
(
$this
->
request
->
isPost
())
{
$data
=
input
(
'post.'
);
//新增或者编辑数据
if
(
empty
(
$
data
[
'id'
]))
{
if
(
empty
(
$
this
->
params
[
'id'
]))
{
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
''
;
$id
=
0
;
}
else
{
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
$
data
[
'id'
];
$id
=
$
this
->
params
[
'id'
];
}
//判断name是否重复
if
(
$table
->
repetition
(
'phone'
,
$data
[
'phone'
])
&&
empty
(
$id
))
{
return
$this
->
response
(
100
,
'存在重复值'
);
if
(
empty
(
$id
))
{
$num
=
$m_agent
->
getListDistrictTotal
([
'phone'
=>
$this
->
params
[
'phone'
]]);
if
(
$num
>
0
)
{
return
$this
->
response
(
101
,
'手机号重复'
);
}
}
if
(
empty
(
$this
->
params
[
'store_id'
]))
{
return
$this
->
response
(
10
0
,
'门店id为空!'
);
return
$this
->
response
(
10
1
,
'门店id为空!'
);
}
$store
=
new
AStore
();
$data
[
'district_id'
]
=
$store
->
getStoreKeyById
(
'district_id'
,
[
'id'
=>
$this
->
params
[
'store_id'
]]);
$data
[
'password'
]
=
md5
(
substr
(
$data
[
'phone'
],
-
6
));
if
(
$table
->
editData
(
$data
,
$id
))
{
if
(
empty
(
$data
[
'password'
]))
{
$data
[
'password'
]
=
md5
(
substr
(
$this
->
params
[
'password'
],
-
6
));
}
else
{
$data
[
'password'
]
=
md5
(
$this
->
params
[
'password'
]);
}
$data
[
'name'
]
=
trim
(
$this
->
params
[
'name'
]);
$data
[
'store_id'
]
=
$this
->
params
[
'store_id'
];
$data
[
'phone'
]
=
trim
(
$this
->
params
[
'phone'
]);
$data
[
'admin_off'
]
=
$this
->
params
[
'admin_off'
];
$data
[
'sex'
]
=
$this
->
params
[
'sex'
];
$data
[
'remarks'
]
=
$this
->
params
[
'remarks'
];
$data
[
'auth_group_id'
]
=
$this
->
params
[
'auth_group_id'
];
dump
(
$this
->
params
);
die
;
if
(
$m_agent
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
10
0
,
'无修改'
);
return
$this
->
response
(
10
1
,
'无修改'
);
}
}
else
{
//查看
$info
=
$
table
->
where
(
'id'
,
$group_id
)
->
find
();
$info
=
$
m_agent
->
where
(
'id'
,
$group_id
)
->
find
();
return
$this
->
response
(
200
,
'查看'
,
$info
);
}
}
...
...
application/index/view/agent/agent.html
View file @
cc2e279b
{layout name="global/frame_tpl" /}
<input
type=
"hidden"
class=
"page-load"
id=
"agent"
/>
<!--关联经纪人列表liudanjs文件-->
<input
type=
"hidden"
class=
"page-load"
id=
"agent"
/>
<!--关联经纪人列表liudanjs文件-->
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
...
...
@@ -7,12 +8,15 @@
<div
class=
"col-lg-10 col-lg-offset-0"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading breadcrumb"
>
<li><a
href=
"#"
>
经纪人管理
</a></li>
<li>
<a
href=
"#"
>
经纪人管理
</a>
</li>
<li
class=
"active"
>
经纪人列表
</li>
<div
class=
"pull-right"
>
<ul
class=
"bread_btn"
>
<li>
<a
href=
"#modal-edit"
data-toggle=
"modal"
class=
"btn btn-default edit_add"
><i
class=
"icon-plus"
></i>
<a
href=
"#modal-edit"
data-toggle=
"modal"
class=
"btn btn-default agent_add"
>
<i
class=
"icon-plus"
></i>
新增
</a>
</li>
</ul>
...
...
@@ -26,10 +30,12 @@
<tr>
<td
colspan=
"11"
>
<form
id=
"form_search"
>
<a
href=
"#modal-user"
data-toggle=
"modal"
class=
"btn btn-default btn3 ld-Marheight User_add"
>
变更角色
</a>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"industry_type"
placeholder=
"角色"
type=
"text"
value=
""
name=
"groupname"
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"dish"
placeholder=
"门店"
type=
"text"
value=
""
name=
"store_name"
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"id"
placeholder=
"姓名/手机号"
name=
"search"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"industry_type"
placeholder=
"角色"
type=
"text"
value=
""
name=
"groupname"
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"dish"
placeholder=
"门店"
type=
"text"
value=
""
name=
"store_name"
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"id"
placeholder=
"姓名/手机号"
name=
"search"
type=
"text"
value=
""
>
<span
class=
"btn btn-default btn3 ld-Marheight"
id=
"search"
>
搜索
</span>
<span
class=
"btn btn-default btn3 ld-Marheight"
id=
"reset"
>
重置
</span>
...
...
@@ -61,7 +67,7 @@
</div>
</div>
</div>
</div>
</div>
<!--编辑-->
<div
class=
"modal fade"
id=
"modal-edit"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
...
...
@@ -79,15 +85,20 @@
<form
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
用户名:
</label>
<input
class=
"form-control btn6"
data-rule-buga=
"false"
data-rule-required=
"true"
name=
"name"
placeholder=
"登录账户所用名称"
type=
"text"
value=
""
id=
"title"
>
<input
class=
"form-control btn6"
data-rule-buga=
"false"
data-rule-required=
"true"
name=
"name"
placeholder=
"登录账户所用名称"
type=
"text"
value=
""
id=
"title"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
门店ID:
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"store_id"
value=
""
placeholder=
"填写门店ID"
>
<label
class=
"col-sm-3 control-label"
>
电话(登录账号):
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"phone"
value=
""
placeholder=
"填写手机号"
>
</div>
<div
class=
"form-group hide"
>
<label
class=
"col-sm-3 control-label"
>
密码:
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"password"
id=
"password"
value=
""
placeholder=
"填写密码"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
手机号
:
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"
phone"
value=
""
placeholder=
"填写手机号
"
>
<label
class=
"col-sm-3 control-label"
>
绑定门店ID
:
</label>
<input
type=
"number"
class=
"form-control btn6"
name=
"
store_id"
value=
""
placeholder=
"填写门店ID
"
>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
性别:
</label>
...
...
@@ -115,12 +126,6 @@
</label>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
人物角色:
</label>
<select
class=
"form-control btn6"
name=
"auth_group_id"
id=
"auth_group_id"
>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
是否允许访问后台:
</label>
<select
name=
"admin_off"
id=
"admin_off"
class=
"form-control btn6"
>
...
...
@@ -130,29 +135,21 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
个人说明:
</label>
<textarea
name=
"remarks"
id=
"remarks"
class=
"form-control btn6"
length=
"120"
rows=
"5"
placeholder=
"请填写个人说明"
>
</textarea>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
状态:
</label>
<select
name=
"status"
id=
"status"
class=
"form-control btn6"
>
<option
value=
"0"
>
正常
</option>
<option
value=
"1"
>
冻结
</option>
<option
value=
"2"
>
离职
</option>
</select>
<textarea
name=
"remarks"
id=
"remarks"
class=
"form-control btn6"
length=
"120"
rows=
"5"
placeholder=
"请填写个人说明"
></textarea>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary submit_edit"
data-dismiss=
"modal"
>
<button
type=
"button"
class=
"btn btn-primary submit_edit"
>
提交
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
...
...
@@ -165,17 +162,14 @@
×
</button>
<h4
class=
"modal-title"
>
移动选中的用户至
角色设置
</h4>
</div>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
角色选择
:
</label>
<label
class=
"col-sm-3 control-label"
>
权限角色
:
</label>
<select
name=
"status"
class=
"form-control btn6"
id=
"User_add"
>
<!--<option value="0">正常</option>-->
<!--<option value="1" >冻结</option>-->
<!--<option value="2">离职</option>-->
</select>
</div>
</form>
...
...
@@ -187,7 +181,8 @@
提交
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
application/model/AAgents.php
View file @
cc2e279b
...
...
@@ -98,28 +98,6 @@ class AAgents extends BaseModel
return
$data
;
}
/**检查重复
* @param $name
* @param $key
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
repetition
(
$name
,
$key
)
{
$r
=
$this
->
field
(
$name
)
->
where
(
$name
,
'='
,
$key
)
->
select
();
//$this->getLastSql();
if
(
$r
)
{
return
true
;
}
else
{
return
false
;
}
}
//更新数据
public
function
saveStatus
(
$name
,
$key
,
$ids
)
{
...
...
public/resource/js/agent.js
View file @
cc2e279b
This diff is collapsed.
Click to expand it.
public/resource/template/agent_template_tpl.html
View file @
cc2e279b
...
...
@@ -21,7 +21,7 @@
[
%
}
else
{
%
]
<
a
class
=
"btn1 btn-default"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
离职
<
/a
>
[
%
}
%
]
<
a
href
=
"#modal-user"
class
=
"btn1 btn-danger"
href
=
"#modal-edit"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
角色设置
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
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