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
5a3e9e3f
Commit
5a3e9e3f
authored
Oct 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店店长
parent
750fedc3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
19 deletions
+31
-19
Store.php
application/index/controller/Store.php
+0
-5
StoreValidate.php
application/index/validate/StoreValidate.php
+1
-1
AStore.php
application/model/AStore.php
+29
-12
storeList.js
public/resource/js/storeList.js
+1
-1
No files found.
application/index/controller/Store.php
View file @
5a3e9e3f
...
...
@@ -78,11 +78,6 @@ class Store extends Basic
* @throws \think\exception\PDOException3
*/
public
function
addStore
()
{
if
(
empty
(
$this
->
params
[
'agents_id'
]))
{
return
$this
->
response
(
101
,
'参数错误,修改失败!'
);
}
$store_validate
=
new
StoreValidate
();
$store
=
new
AStore
();
$m_district
=
new
ADistrict
();
...
...
application/index/validate/StoreValidate.php
View file @
5a3e9e3f
...
...
@@ -52,7 +52,7 @@ class StoreValidate extends Validate
];
protected
$scene
=
[
'add'
=>
[
'
agents_id'
,
'
province'
,
'city'
,
'district'
,
'address'
,
'longitude'
,
'latitude'
,
'store_name'
,
'scale'
,
'district_id'
],
'add'
=>
[
'province'
,
'city'
,
'district'
,
'address'
,
'longitude'
,
'latitude'
,
'store_name'
,
'scale'
,
'district_id'
],
'edit'
=>
[
'id'
,
'agents_id'
,
'province'
,
'city'
,
'district'
,
'address'
,
'longitude'
,
'latitude'
,
'store_name'
,
'scale'
,
'district_id'
]
];
...
...
application/model/AStore.php
View file @
5a3e9e3f
...
...
@@ -23,6 +23,7 @@ class AStore extends BaseModel
* @throws \think\exception\PDOException3
*/
public
function
addStoreAgents
(
$data
,
$agents_id
)
{
$agents_data
=
[];
$regions
=
new
Regions
();
$code_arr
=
$regions
->
getRegionsCodeByName
(
$data
[
'province'
],
$data
[
'city'
],
$data
[
'district'
]);
$store_data
[
'province'
]
=
$data
[
'province'
];
...
...
@@ -46,14 +47,38 @@ class AStore extends BaseModel
$result_id
=
$data
[
'id'
];
}
//处理经纪人等级 10业务员 20店长 30总监 40店长和总监
$agents
=
new
AAgents
();
$agents_info
=
$agents
->
where
([
'store_id'
=>
$data
[
'id'
],
'level'
=>
[
'in'
,
'20,40'
]
])
->
column
(
'id,level'
);
if
(
$agents_info
)
{
$agents_data
=
[];
if
(
$result_id
&&
!
empty
(
$agents_id
))
{
//处理经纪人等级 10业务员 20店长 30总监 40店长和总监
if
(
$agents_info
)
{
foreach
(
$agents_info
as
$k
=>
$v
)
{
if
(
$agents_id
!=
$k
)
{
//40等级和店长降级为业务员
$agents_data
[
$k
][
'id'
]
=
$k
;
if
(
$v
[
'level'
]
==
20
)
{
$agents_data
[
$k
][
'level'
]
=
10
;
}
else
{
$agents_data
[
$k
][
'level'
]
=
30
;
}
$agents_data
[
$k
][
'store_id'
]
=
$result_id
;
}
}
$agents
->
saveAll
(
$agents_data
);
}
$level
=
$agents
->
getAgentsById
(
$agents_id
,
'level'
);
if
(
$level
==
30
)
{
$agents_store
[
'level'
]
=
40
;
}
else
{
$agents_store
[
'level'
]
=
20
;
}
$agents_store
[
'store_id'
]
=
$result_id
;
$agents
->
editData
(
$agents_store
,
$agents_id
,
'id'
);
}
else
{
foreach
(
$agents_info
as
$k
=>
$v
)
{
if
(
$agents_id
!=
$k
)
{
//40等级和店长降级为业务员
...
...
@@ -63,20 +88,12 @@ class AStore extends BaseModel
}
else
{
$agents_data
[
$k
][
'level'
]
=
30
;
}
$agents_data
[
$k
][
'store_id'
]
=
$result_id
;
}
}
$agents
->
saveAll
(
$agents_data
);
}
$level
=
$agents
->
getAgentsById
(
$agents_id
,
'level'
);
if
(
$level
==
30
)
{
$agents_store
[
'level'
]
=
40
;
}
else
{
$agents_store
[
'level'
]
=
20
;
}
$agents_store
[
'store_id'
]
=
$result_id
;
$agents
->
editData
(
$agents_store
,
$agents_id
,
'id'
);
return
$result_id
;
}
...
...
public/resource/js/storeList.js
View file @
5a3e9e3f
...
...
@@ -257,7 +257,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
par
.
store_name
=
$
(
"input[name =name]"
).
val
();
//门店名
par
.
scale
=
$
(
"#pid-select option:selected"
).
val
();
//规模
par
.
district_id
=
$
(
"#ss-store option:selected"
).
val
();
//部门id
if
(
!
(
par
.
agents_id
&&
par
.
province
&&
par
.
city
&&
par
.
district
&&
par
.
address
&&
par
.
longitude
&&
par
.
latitude
&&
par
.
store_name
&&
par
.
scale
&&
par
.
district_id
)){
if
(
!
(
par
.
province
&&
par
.
city
&&
par
.
district
&&
par
.
address
&&
par
.
longitude
&&
par
.
latitude
&&
par
.
store_name
&&
par
.
scale
&&
par
.
district_id
)){
alert
(
'请将内容填写完整'
);
return
;
}
...
...
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