Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
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
newshop
newShopBack
Commits
ea1fd531
Commit
ea1fd531
authored
Dec 20, 2019
by
郭勇志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o2o更新
parent
6d0fc334
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
O2oDeliveryController.php
backend/controllers/v1/transport/O2oDeliveryController.php
+8
-2
ShopCityDistributionSetting.php
backend/models/v1/branch/ShopCityDistributionSetting.php
+0
-1
No files found.
backend/controllers/v1/transport/O2oDeliveryController.php
View file @
ea1fd531
...
...
@@ -137,6 +137,10 @@ class O2oDeliveryController extends BaseController
$branchGuid
=
$userInfo
[
'BRANCH_GUID'
];
$parentBranchGuid
=
''
;
break
;
default
:
$branchGuid
=
''
;
$parentBranchGuid
=
''
;
break
;
}
$infoArr
=
$model
->
find
()
->
alias
(
'scds'
)
...
...
@@ -192,10 +196,12 @@ class O2oDeliveryController extends BaseController
$model
=
new
$this
->
modelClass
;
$model
->
scenario
=
'o2o_update'
;
$model
->
load
(
$put
,
''
);
//guid不是安全属性需要单独设置
$model
->
GUID
=
$put
[
'GUID'
];
$scdrModel
=
new
ShopCityDistributionRegion
();
if
(
$model
->
validate
())
{
if
(
$model
->
REGION_TYPE
==
1
)
{
//按区域
if
(
$model
->
REGION_TYPE
==
REGION_TYPE_REGION
)
{
//按区域
$_scdrModel
=
$scdrModel
->
find
()
->
where
([
'CITY_DISTR_GUID'
=>
$model
->
GUID
])
->
one
();
if
(
empty
(
$_scdrModel
))
{
...
...
@@ -208,7 +214,7 @@ class O2oDeliveryController extends BaseController
throw
new
HttpException
(
500
,
'更新失败'
);
}
}
}
elseif
(
$model
->
REGION_TYPE
==
2
){
//按距离
}
elseif
(
$model
->
REGION_TYPE
==
REGION_TYPE_DISTANCE
){
//按距离
$_model
=
$model
->
findOne
(
$model
->
GUID
);
if
(
empty
(
$_model
))
{
throw
new
HttpException
(
"404"
,
'此条数据不存在'
);
...
...
backend/models/v1/branch/ShopCityDistributionSetting.php
View file @
ea1fd531
...
...
@@ -60,7 +60,6 @@ class ShopCityDistributionSetting extends BaseModel
{
return
[
[[
'ORG_GUID'
,
'GUID'
,
'BRANCH_GUID'
,
'REGION_TYPE'
,
'SETTING_TYPE'
],
'required'
,
'on'
=>
[
'insert'
,
'update'
]],
[[
'STATUS'
],
'boolean'
],
[[
'REGION_TYPE'
,
'SETTING_TYPE'
],
'in'
,
'range'
=>
[
1
,
2
],
'on'
=>
[
'insert'
,
'update'
,
'o2o_update'
],
'message'
=>
'{attribute}只能为1或2'
],
[[
'BRANCH_GUID'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
ShopBranch
::
className
(),
'targetAttribute'
=>
[
'BRANCH_GUID'
=>
'GUID'
]],
...
...
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