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
9ff32c2d
Commit
9ff32c2d
authored
Oct 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店站点id
parent
f2d7b7c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
Store.php
application/index/controller/Store.php
+16
-1
AStore.php
application/model/AStore.php
+3
-2
No files found.
application/index/controller/Store.php
View file @
9ff32c2d
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\validate\StoreValidate
;
use
app\index\validate\StoreValidate
;
use
app\model\ADistrict
;
use
app\model\AStore
;
use
app\model\AStore
;
class
Store
extends
Basic
class
Store
extends
Basic
...
@@ -83,16 +84,30 @@ class Store extends Basic
...
@@ -83,16 +84,30 @@ class Store extends Basic
}
}
$store_validate
=
new
StoreValidate
();
$store_validate
=
new
StoreValidate
();
$store
=
new
AStore
();
$m_district
=
new
ADistrict
();
if
(
empty
(
$this
->
params
[
'id'
]))
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
if
(
!
$store_validate
->
scene
(
'add'
)
->
check
(
$this
->
params
))
{
if
(
!
$store_validate
->
scene
(
'add'
)
->
check
(
$this
->
params
))
{
return
$this
->
response
(
101
,
$store_validate
->
getError
());
return
$this
->
response
(
101
,
$store_validate
->
getError
());
}
}
$this
->
params
[
'site_id'
]
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$this
->
params
[
'district_id'
]]);
}
else
{
}
else
{
if
(
!
$store_validate
->
scene
(
'edit'
)
->
check
(
$this
->
params
))
{
if
(
!
$store_validate
->
scene
(
'edit'
)
->
check
(
$this
->
params
))
{
return
$this
->
response
(
101
,
$store_validate
->
getError
());
return
$this
->
response
(
101
,
$store_validate
->
getError
());
}
}
$district_id
=
$store
->
getStoreKeyById
(
'district_id'
,
[
'id'
=>
$this
->
params
[
'id'
]]);
$old_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$district_id
]);
$new_site_id
=
$m_district
->
getDistrictKeyById
(
'site_id'
,
[
'id'
=>
$this
->
params
[
'district_id'
]]);
if
(
$old_site_id
!=
$new_site_id
)
{
return
$this
->
response
(
101
,
'编辑门店部门,导致所属城市不一致'
);
}
$this
->
params
[
'site_id'
]
=
$new_site_id
;
}
}
$store
=
new
AStore
();
$this
->
data
=
$store
->
addStoreAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
$this
->
data
=
$store
->
addStoreAgents
(
$this
->
params
,
$this
->
params
[
'agents_id'
]);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
...
...
application/model/AStore.php
View file @
9ff32c2d
...
@@ -34,15 +34,16 @@ class AStore extends BaseModel
...
@@ -34,15 +34,16 @@ class AStore extends BaseModel
$store_data
[
'store_name'
]
=
$data
[
'store_name'
];
$store_data
[
'store_name'
]
=
$data
[
'store_name'
];
$store_data
[
'scale'
]
=
$data
[
'scale'
];
$store_data
[
'scale'
]
=
$data
[
'scale'
];
$store_data
[
'district_id'
]
=
$data
[
'district_id'
];
$store_data
[
'district_id'
]
=
$data
[
'district_id'
];
$store_data
[
'site_id'
]
=
$data
[
'site_id'
];
$store_data
[
'code'
]
=
implode
(
'##'
,
$code_arr
);
$store_data
[
'code'
]
=
implode
(
'##'
,
$code_arr
);
if
(
$data
[
'id'
]
==
''
)
{
if
(
$data
[
'id'
]
==
''
)
{
$store_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$store_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
save
(
$store_data
);
$this
->
save
(
$store_data
);
$resu
t
lt
=
$this
->
id
;
$result
=
$this
->
id
;
}
else
{
}
else
{
$this
->
save
(
$store_data
,
[
'id'
=>
$data
[
'id'
]]);
$this
->
save
(
$store_data
,
[
'id'
=>
$data
[
'id'
]]);
$resu
t
lt
=
$data
[
'id'
];
$result
=
$data
[
'id'
];
}
}
//处理经纪人等级 10业务员 20店长 30总监 40店长和总监
//处理经纪人等级 10业务员 20店长 30总监 40店长和总监
...
...
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