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
40f5352d
Commit
40f5352d
authored
Dec 09, 2019
by
侯贺政
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运费模板,门店打分优化
Signed-off-by:
houhezheng
<
houhezheng@romens.cn
>
parent
07f4652f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
30 deletions
+11
-30
TransportSettingController.php
...d/controllers/v1/transport/TransportSettingController.php
+7
-28
ShopBranchScore.php
backend/models/v1/branch/ShopBranchScore.php
+0
-1
TransportSetting.php
backend/models/v1/transport/TransportSetting.php
+4
-1
No files found.
backend/controllers/v1/transport/TransportSettingController.php
View file @
40f5352d
...
...
@@ -178,6 +178,7 @@ class TransportSettingController extends BaseController
{
$params
=
Yii
::
$app
->
request
->
bodyParams
;
$model
=
new
$this
->
modelClass
();
$model
->
scenario
=
'update'
;
$_model
=
$model
::
findOne
(
$params
[
'GUID'
]);
if
(
!
$_model
)
{
throw
new
BadRequestHttpException
(
'Requested resource does not exist !'
);
...
...
@@ -191,18 +192,7 @@ class TransportSettingController extends BaseController
throw
new
BadRequestHttpException
(
'没有修改权限!'
);
}
$_model
->
attributes
=
[
"TRANSPOR_TTYPE"
=>
$params
[
'TRANSPOR_TTYPE'
],
"BASE_FEE"
=>
is_numeric
(
$params
[
'BASE_FEE'
])
?
$params
[
'BASE_FEE'
]
:
0
,
"BASE_WEIGHT"
=>
is_numeric
(
$params
[
'BASE_WEIGHT'
])
?
$params
[
'BASE_WEIGHT'
]
:
'0'
,
"BASE_WEIGHT_FEE"
=>
is_numeric
(
$params
[
'BASE_WEIGHT_FEE'
])
?
$params
[
'BASE_WEIGHT_FEE'
]
:
0
,
"INCREASE_WEIGHT"
=>
is_numeric
(
$params
[
'INCREASE_WEIGHT'
])
?
$params
[
'INCREASE_WEIGHT'
]
:
'0'
,
"INCREASE_WEIGHT_FEE"
=>
is_numeric
(
$params
[
'INCREASE_WEIGHT_FEE'
])
?
$params
[
'INCREASE_WEIGHT_FEE'
]
:
0
,
"IS_USED"
=>
is_null
(
$params
[
'IS_USED'
])
?
1
:
$params
[
'IS_USED'
],
"DESCRIPTION"
=>
$params
[
'DESCRIPTION'
],
"LIMIT_MEMBER_GROUP_GUID"
=>
$params
[
'LIMIT_MEMBER_GROUP_GUID'
],
"SELECT_AREA"
=>
$params
[
'SELECT_AREA'
],
];
$_model
->
attributes
=
$params
;
//删除条件:总部权限删除所有,省级只能删除自己。
switch
(
$userInfo
[
'ROLE_ID'
])
{
...
...
@@ -373,22 +363,11 @@ class TransportSettingController extends BaseController
$userInfo
=
(
new
ShopRbacUser
)
->
getRbacUserInfo
(
Yii
::
$app
->
user
->
identity
->
GUID
);
$model
=
new
$this
->
modelClass
();
$model
->
scenario
=
'creation'
;
$model
->
attributes
=
[
"GUID"
=>
Func
::
create_guid
(),
"ORG_GUID"
=>
Yii
::
$app
->
user
->
identity
->
ORG_GUID
,
"TRANSPOR_TTYPE"
=>
$params
[
'TRANSPOR_TTYPE'
],
"BASE_FEE"
=>
is_numeric
(
$params
[
'BASE_FEE'
])
?
$params
[
'BASE_FEE'
]
:
0
,
"BASE_WEIGHT"
=>
is_numeric
(
$params
[
'BASE_WEIGHT'
])
?
$params
[
'BASE_WEIGHT'
]
:
'0'
,
"BASE_WEIGHT_FEE"
=>
is_numeric
(
$params
[
'BASE_WEIGHT_FEE'
])
?
$params
[
'BASE_WEIGHT_FEE'
]
:
0
,
"INCREASE_WEIGHT"
=>
is_numeric
(
$params
[
'INCREASE_WEIGHT'
])
?
$params
[
'INCREASE_WEIGHT'
]
:
'0'
,
"INCREASE_WEIGHT_FEE"
=>
is_numeric
(
$params
[
'INCREASE_WEIGHT_FEE'
])
?
$params
[
'INCREASE_WEIGHT_FEE'
]
:
0
,
"IS_USED"
=>
is_null
(
$params
[
'IS_USED'
])
?
1
:
$params
[
'IS_USED'
],
"DESCRIPTION"
=>
$params
[
'DESCRIPTION'
],
"LIMIT_MEMBER_GROUP_GUID"
=>
$params
[
'LIMIT_MEMBER_GROUP_GUID'
],
"SELECT_AREA"
=>
$params
[
'SELECT_AREA'
],
"GROUP_GUID"
=>
$userInfo
[
'BRANCH_GUID'
],
"PLATFORM_TYPE"
=>
empty
(
$params
[
'PLATFORM_TYPE'
])
?
'shop'
:
$params
[
'PLATFORM_TYPE'
],
];
$model
->
attributes
=
$params
;
$model
->
GUID
=
Func
::
create_guid
();
$model
->
ORG_GUID
=
Yii
::
$app
->
user
->
identity
->
ORG_GUID
;
$model
->
GROUP_GUID
=
$userInfo
[
'BRANCH_GUID'
];
//开启事务
$packagingcostsBranches
=
new
ShopPackagingcostsBranches
();
...
...
backend/models/v1/branch/ShopBranchScore.php
View file @
40f5352d
...
...
@@ -4,7 +4,6 @@ namespace app\models\v1\branch;
use
Yii
;
use
app\models\v1\BaseModel
;
use
backend\helpers\Func
;
use
yii\data\ActiveDataProvider
;
/**
...
...
backend/models/v1/transport/TransportSetting.php
View file @
40f5352d
...
...
@@ -50,6 +50,9 @@ class TransportSetting extends \app\models\v1\BaseModel
[[
'GUID'
,
'ORG_GUID'
,
'TRANSPOR_TTYPE'
,
'TRANSPORT_COMPANY'
,
'BASE_WEIGHT'
,
'INCREASE_WEIGHT'
,
'PLATFORM_TYPE'
,
'GROUP_GUID'
],
'string'
,
'max'
=>
50
],
[[
'DESCRIPTION'
],
'string'
,
'max'
=>
300
],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'creation'
]],
[[
'BASE_FEE'
,
'BASE_WEIGHT_FEE'
,
'INCREASE_WEIGHT_FEE'
,
'BASE_WEIGHT'
,
'INCREASE_WEIGHT'
],
'default'
,
'value'
=>
0
,
'on'
=>
[
'creation'
,
'update'
]],
[
'IS_USED'
,
'defalut'
,
'value'
=>
1
,
'on'
=>
[
'creation'
,
'update'
]],
[
'PLATFORM_TYPE'
,
'default'
,
'value'
=>
'shop'
,
'on'
=>
'creation'
],
];
}
...
...
@@ -97,7 +100,7 @@ class TransportSetting extends \app\models\v1\BaseModel
$where
=
[
'or'
,
[
'ts.GROUP_GUID'
=>
$userInfo
[
'PARENT_BRANCH_GUID'
]],
[
'ts.GROUP_GUID'
=>
$userInfo
[
'BRANCH_GUID'
]]];
break
;
default
:
$where
=
[
'>'
,
1
,
2
];
$where
=
[
'>'
,
1
,
2
];
break
;
}
...
...
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