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
a3a45d8e
Commit
a3a45d8e
authored
Dec 04, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
require
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
6ab6533a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
BranchController.php
backend/controllers/v1/branch/BranchController.php
+20
-4
No files found.
backend/controllers/v1/branch/BranchController.php
View file @
a3a45d8e
...
...
@@ -15,7 +15,7 @@ use backend\helpers\Func;
use
yii\web\ServerErrorHttpException
;
use
yidas\phpSpreadsheet\Helper
;
use
yii\data\ActiveDataProvider
;
use
app\models\v1\rbacuser\ShopRbacUser
;
class
BranchController
extends
BaseController
{
...
...
@@ -55,11 +55,27 @@ class BranchController extends BaseController
* )
*/
public
function
actionBranchList
()
{
{
//权限信息
$rbac
=
new
ShopRbacUser
();
$userGuid
=
Yii
::
$app
->
user
->
identity
->
GUID
;
$userinfo
=
$rbac
->
getRbacUserInfo
(
$userGuid
);
// print_r($userinfo);die();
$where_branch
=
''
;
//是否是 分公司管理员 是的话只显示所管理门店的数据
if
(
$userinfo
[
'ROLE_ID'
]
==
'2'
){
$branchguids_str
=
$userinfo
[
'BRANCH_GUID'
];
$where_branch
=
empty
(
$branchguids_str
)
?
$userinfo
[
'SUPPROVINCE_GUID'
]
:
"'"
.
$userinfo
[
'SUPPROVINCE_GUID'
]
.
"',"
.
$branchguids_str
;
}
elseif
(
$userinfo
[
'ROLE_ID'
]
==
'3'
){
//门店
$branchguid
=
$userinfo
[
'BRANCH_GUID'
];
$where_branch
=
!
empty
(
$branchguid
)
?
$branchguid
:
''
;
}
$model
=
new
$this
->
modelClass
();
$params
=
Yii
::
$app
->
request
->
queryParams
;
$model
->
attributes
=
$params
;
$params
[
'where_branch'
]
=
$where_branch
;
if
(
$model
->
validate
())
{
//所有输入数据都有效 all inputs are valid
...
...
@@ -74,8 +90,8 @@ class BranchController extends BaseController
return
$info
;
}
else
{
//验证失败:$errors 是一个包含错误信息的数组
$errors
=
$model
->
errors
;
return
$errors
;
Yii
::
$app
->
response
->
statusCode
=
422
;
return
$
model
->
errors
;
}
}
...
...
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