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
3cd6c9ef
Commit
3cd6c9ef
authored
Dec 30, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://gitlab-ebiz.yiyao365.cn/newshop/newshopback
into development
parents
170bdf1a
8ad5fd66
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
9 deletions
+46
-9
urlmanager.php
backend/config/urlmanager.php
+1
-0
CompanyController.php
backend/controllers/v1/transport/CompanyController.php
+9
-5
TransportMethodController.php
...nd/controllers/v1/transport/TransportMethodController.php
+32
-1
ShopTransportCompany.php
backend/models/v1/transport/ShopTransportCompany.php
+4
-3
No files found.
backend/config/urlmanager.php
View file @
3cd6c9ef
...
@@ -279,6 +279,7 @@ return [
...
@@ -279,6 +279,7 @@ return [
'GET,OPTIONS make-use'
=>
'make-use'
,
'GET,OPTIONS make-use'
=>
'make-use'
,
'POST,OPTIONS transport-method-insert'
=>
'transport-method-insert'
,
'POST,OPTIONS transport-method-insert'
=>
'transport-method-insert'
,
'PUT,OPTIONS transport-method-update'
=>
'transport-method-update'
,
'PUT,OPTIONS transport-method-update'
=>
'transport-method-update'
,
'GET,OPTIONS get-transport-detail'
=>
'get-transport-detail'
,
],
],
],
],
//权限-角色
//权限-角色
...
...
backend/controllers/v1/transport/CompanyController.php
View file @
3cd6c9ef
...
@@ -116,7 +116,7 @@ class CompanyController extends BaseController
...
@@ -116,7 +116,7 @@ class CompanyController extends BaseController
$model
->
scenario
=
'create'
;
//创建的场景
$model
->
scenario
=
'create'
;
//创建的场景
$other_param
=
array
(
$other_param
=
array
(
'GUID'
=>
Func
::
create_guid
(),
'GUID'
=>
Func
::
create_guid
(),
'ORG_GUID'
=>
Yii
::
$app
->
user
->
identity
->
ORG_GUID
,
'ORG_GUID'
=>
'100'
,
//
Yii::$app->user->identity->ORG_GUID,
);
);
$model
->
setAttributes
(
$other_param
);
$model
->
setAttributes
(
$other_param
);
$model
->
setAttributes
(
Yii
::
$app
->
request
->
getBodyparams
());
$model
->
setAttributes
(
Yii
::
$app
->
request
->
getBodyparams
());
...
@@ -125,6 +125,8 @@ class CompanyController extends BaseController
...
@@ -125,6 +125,8 @@ class CompanyController extends BaseController
throw
new
HttpException
(
201
,
'添加成功'
);
throw
new
HttpException
(
201
,
'添加成功'
);
}
elseif
(
!
$model
->
hasErrors
())
{
}
elseif
(
!
$model
->
hasErrors
())
{
throw
new
HttpException
(
500
,
'添加失败'
);
throw
new
HttpException
(
500
,
'添加失败'
);
}
else
{
return
$model
;
}
}
}
}
...
@@ -167,11 +169,13 @@ class CompanyController extends BaseController
...
@@ -167,11 +169,13 @@ class CompanyController extends BaseController
$model
->
scenario
=
'update'
;
//创建的场景
$model
->
scenario
=
'update'
;
//创建的场景
$model
->
setAttributes
(
Yii
::
$app
->
request
->
getBodyparams
());
$model
->
setAttributes
(
Yii
::
$app
->
request
->
getBodyparams
());
if
(
$model
->
save
()
===
false
&&
!
$model
->
hasErrors
())
{
if
(
$model
->
save
())
{
throw
new
HttpException
(
500
,
'修改失败'
);
}
throw
new
HttpException
(
200
,
'修改成功'
);
throw
new
HttpException
(
200
,
'修改成功'
);
}
elseif
(
!
$model
->
hasErrors
())
{
throw
new
HttpException
(
500
,
'添加失败'
);
}
else
{
return
$model
;
}
}
}
/**
/**
...
...
backend/controllers/v1/transport/TransportMethodController.php
View file @
3cd6c9ef
...
@@ -48,8 +48,39 @@ class TransportMethodController extends BaseController{
...
@@ -48,8 +48,39 @@ class TransportMethodController extends BaseController{
// ]);
// ]);
return
$query
;
return
$query
;
}
}
/**
/**
* @OA\GET(
* path="/backend/web/v1/transport/transport-methods/get-transport-detail",
* tags={"配送管理"},
* summary="获取配送方式详情(张晓林)",
* description="获取配送方式详情",
* @OA\Response(response="200",description="
* GUID:配送方式GUID,
* CODE:配送方式CODE
* NAME:名称,
* DESCRIPTION:描述,
* STATE:是否启用:1 启用 0 不启用,
* IS_UNDERLINE_PAY:是否支持线下付款 1 支持 0 不支持,
* POINTS_STATE:在积分商城中是否启用:1 启用 0 不启用,
* ROMENS_RENT_STATE:在小程序中是否启用:1 启用 0 不启用,
* DSDINTERVAL:定时达时间间隔,
* TRANSPOR_TYPE:配送方式类型:1 门店B2C配送 2 门店O2O配送方式 3 DC仓B2C,
* EXTRA_MONEY:额外费用,
* DELIVERY_TIME:配送时间,
* ORDER_INDEX:排序序号"),
* security={{"Authorization":{}}}
* )
*/
public
function
actionGetTransportDetail
(){
$param
=
Yii
::
$app
->
request
->
get
();
$model
=
new
TransportMethod
();
$columnArr
=
array
(
'GUID'
,
'CODE'
,
'NAME'
,
'DESCRIPTION'
,
'STATE'
,
'IS_UNDERLINE_PAY'
,
'POINTS_STATE'
,
'ROMENS_RENT_STATE'
,
'DSDINTERVAL'
,
'TRANSPOR_TYPE'
,
'EXTRA_MONEY'
,
'DELIVERY_TIME'
,
'ORDER_INDEX'
);
$query
=
$model
::
find
()
->
select
(
$columnArr
)
->
where
([
'ORG_GUID'
=>
100
,
'GUID'
=>
$param
[
'GUID'
]])
->
one
();
return
$query
;
}
/**
* @OA\GET(
* @OA\GET(
* path="/backend/web/v1/transport/transport-methods/make-use",
* path="/backend/web/v1/transport/transport-methods/make-use",
* tags={"配送管理"},
* tags={"配送管理"},
...
...
backend/models/v1/transport/ShopTransportCompany.php
View file @
3cd6c9ef
...
@@ -38,10 +38,11 @@ class ShopTransportCompany extends BaseModel
...
@@ -38,10 +38,11 @@ class ShopTransportCompany extends BaseModel
*/
*/
public
function
scenarios
()
public
function
scenarios
()
{
{
return
[
$scenarios
=
[
self
::
SCENARIO_CREATE
=>
[
'GUID'
,
'ORG_GUID'
,
'CODE'
,
'NAME'
,
'PHONE'
,
'DESCRIPTION'
,
'IS_DEFAULT'
],
self
::
SCENARIO_CREATE
=>
[
'GUID'
,
'ORG_GUID'
,
'CODE'
,
'NAME'
,
'PHONE'
,
'DESCRIPTION'
,
'IS_DEFAULT'
],
self
::
SCENARIO_UPDATE
=>
[
'CODE'
,
'NAME'
,
'PHONE'
,
'DESCRIPTION'
,
'IS_DEFAULT'
],
self
::
SCENARIO_UPDATE
=>
[
'CODE'
,
'NAME'
,
'PHONE'
,
'DESCRIPTION'
,
'IS_DEFAULT'
],
];
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
}
/**
/**
...
@@ -50,8 +51,8 @@ class ShopTransportCompany extends BaseModel
...
@@ -50,8 +51,8 @@ class ShopTransportCompany extends BaseModel
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'GUID'
,
'ORG_GUID'
,
'CODE'
,
'IS_DEFAULT'
,
'NAME'
],
'required'
,
'
message'
=>
'{attribute}为必填项'
,
'on'
=>
self
::
SCENARIO_CREATE
],
[[
'GUID'
,
'ORG_GUID'
,
'CODE'
,
'IS_DEFAULT'
,
'NAME'
],
'required'
,
'
on'
=>
[
self
::
SCENARIO_CREATE
]
],
[[
'CODE'
,
'IS_DEFAULT'
,
'NAME'
],
'required'
,
'
message'
=>
'{attribute}为必填项'
,
'on'
=>
self
::
SCENARIO_UPDATE
],
[[
'CODE'
,
'IS_DEFAULT'
,
'NAME'
],
'required'
,
'
on'
=>
[
self
::
SCENARIO_UPDATE
]
],
[[
'PHONE'
],
'match'
,
'pattern'
=>
'/^1\d{10}$/'
,
'message'
=>
'手机号格式不正确'
],
[[
'PHONE'
],
'match'
,
'pattern'
=>
'/^1\d{10}$/'
,
'message'
=>
'手机号格式不正确'
],
[[
'IS_DEFAULT'
],
'boolean'
,
'message'
=>
'{attribute}传值错误'
],
[[
'IS_DEFAULT'
],
'boolean'
,
'message'
=>
'{attribute}传值错误'
],
];
];
...
...
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