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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
36 deletions
+30
-36
Agent.php
application/index/controller/Agent.php
+29
-13
agent.html
application/index/view/agent/agent.html
+0
-0
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
This diff is collapsed.
Click to expand it.
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