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
272cc68c
Commit
272cc68c
authored
Dec 19, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品子图model及权限角色优化
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
81aacbf6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
5 deletions
+76
-5
AuthorityRoleController.php
backend/controllers/v1/authority/AuthorityRoleController.php
+2
-5
ShopSAttach.php
backend/models/v1/shopgoods/ShopSAttach.php
+74
-0
No files found.
backend/controllers/v1/authority/AuthorityRoleController.php
View file @
272cc68c
...
...
@@ -196,10 +196,6 @@ class AuthorityRoleController extends BaseController
if
(
!
empty
(
$params
[
'ROLE_ID'
])
&&
!
empty
(
$params
[
'NODE_ID'
]))
{
$res
=
$model
->
delRoleAuthorities
(
$params
[
'ROLE_ID'
]);
}
//验证
// if (!$res) {
// throw new BadRequestHttpException('删除原有角色的权限失败,请稍后重试');
// }
//然后添加角色的权限
if
(
!
$params
[
'NODE_ID'
])
{
throw
new
BadRequestHttpException
(
'未给角色添加权限'
);
...
...
@@ -217,7 +213,8 @@ class AuthorityRoleController extends BaseController
$_model
=
clone
$model
;
$_model
->
setAttributes
(
$attributes
);
if
(
!
$_model
->
save
())
{
throw
new
BadRequestHttpException
(
'保存角色权限节点ID失败'
);
Yii
::
$app
->
response
->
statusCode
=
422
;
return
$_model
->
errors
;
}
}
Yii
::
$app
->
getResponse
()
->
setStatusCode
(
203
);
...
...
backend/models/v1/shopgoods/ShopSAttach.php
0 → 100644
View file @
272cc68c
<?php
namespace
app\models\v1\shopgoods
;
use
Yii
;
use
app\models\v1\BaseModel
;
/**
* This is the model class for table "shop_s_attach".
*
* @property string $GUID
* @property string|null $ORG_GUID
* @property string $GOODS_GUID 商品GUID,图片是关联的详情页的图片的话:0顶部图片,1是底部图片
* @property string|null $SUPCOMPANY_GUID 所属部门编号,关联SHOP_BRANCH表GUID
* @property string|null $GROUNDING_TIME
* @property string|null $URI 图片路径
* @property string|null $HOST_NAME 域名前缀部分
* @property string|null $ORDER_INDEX 序号
* @property string|null $PIC_EXTENSIONS 图片后缀
* @property int|null $TYPE 1:商品扩展信息图片 2:处方单图片 3:退货的商品图片
*/
class
ShopSAttach
extends
BaseModel
{
/**
* {@inheritdoc}
*/
public
static
function
tableName
()
{
return
'shop_s_attach'
;
}
/**
* {@inheritdoc}
*/
public
function
rules
()
{
return
[
[[
'GUID'
,
'GOODS_GUID'
],
'required'
],
[[
'GROUNDING_TIME'
],
'safe'
],
[[
'TYPE'
],
'integer'
],
[[
'GUID'
,
'ORG_GUID'
,
'GOODS_GUID'
,
'SUPCOMPANY_GUID'
],
'string'
,
'max'
=>
50
],
[[
'URI'
,
'HOST_NAME'
,
'PIC_EXTENSIONS'
],
'string'
,
'max'
=>
200
],
[[
'ORDER_INDEX'
],
'string'
,
'max'
=>
10
],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'create'
]],
];
}
/**
* {@inheritdoc}
*/
public
function
attributeLabels
()
{
return
[
'GUID'
=>
'Guid'
,
'ORG_GUID'
=>
'Org Guid'
,
'GOODS_GUID'
=>
'Goods Guid'
,
'SUPCOMPANY_GUID'
=>
'Supcompany Guid'
,
'GROUNDING_TIME'
=>
'Grounding Time'
,
'URI'
=>
'Uri'
,
'HOST_NAME'
=>
'Host Name'
,
'ORDER_INDEX'
=>
'Order Index'
,
'PIC_EXTENSIONS'
=>
'Pic Extensions'
,
'TYPE'
=>
'Type'
,
];
}
/**
* 删除商品子图信息
*/
public
function
deleteByGoodsGuid
(
$GOODS_GUID
)
{
$goods_subimg
=
static
::
deleteAll
([
'GOODS_GUID'
=>
$GOODS_GUID
]);
return
$goods_subimg
;
}
}
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