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
e50189d2
Commit
e50189d2
authored
Dec 03, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yh
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
8c11d99b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
ShopBranch.php
backend/models/v1/branch/ShopBranch.php
+20
-3
ShopCityDistributionRegion.php
backend/models/v1/branch/ShopCityDistributionRegion.php
+8
-2
No files found.
backend/models/v1/branch/ShopBranch.php
View file @
e50189d2
...
...
@@ -299,11 +299,16 @@ class ShopBranch extends BaseModel
if
(
isset
(
$params
[
'RECIVER_REGION'
]))
{
$query
->
andfilterWhere
([
'like'
,
'sb.RECIVER_REGION'
,
$params
[
'RECIVER_REGION'
]]);
}
//门店guid 权限
if
(
isset
(
$params
[
'where_branch'
])
&&
!
empty
(
$params
[
'where_branch'
])){
$branch_arr
=
explode
(
','
,
$params
[
'where_branch'
]);
$query
->
andfilterWhere
([
'sb.GUID'
=>
$branch_arr
]);
}
return
new
ActiveDataProvider
([
'query'
=>
$query
->
asArray
(),
'pagination'
=>
[
'pageSize'
=>
10
'pageSize'
=>
PAGE_SIZE
],
'sort'
=>
[
'attributes'
=>
[
...
...
@@ -326,7 +331,19 @@ class ShopBranch extends BaseModel
->
where
([
'GUID'
=>
$GUID
])
->
asArray
()
->
one
();
return
$query
;
}
//获取门店(权限下的)
public
function
GetBranch
(
$GUID
,
$SUPPROVINCE_GUID
)
{
$query
=
static
::
find
()
->
select
(
'GUID,SUPPROVINCE_GUID'
)
->
where
([
'GUID'
=>
$GUID
])
->
andWhere
([
'like'
,
'SUPPROVINCE_GUID'
,
$SUPPROVINCE_GUID
])
->
asArray
()
->
one
();
return
$query
;
}
/**
...
...
backend/models/v1/branch/ShopCityDistributionRegion.php
View file @
e50189d2
...
...
@@ -93,13 +93,19 @@ class ShopCityDistributionRegion extends BaseModel
->
where
([
'cs.SETTING_TYPE'
=>
2
]);
//门店名称或编码
if
(
isset
(
$params
)
&&
!
empty
(
$params
))
{
if
(
isset
(
$params
[
'CODE'
])
&&
!
empty
(
$params
[
'CODE'
]
))
{
$query
->
andfilterWhere
([
'or'
,
[
'like'
,
'sb.CODE'
,
$params
[
'CODE'
]],[
'like'
,
'sb.NAME'
,
$params
[
'CODE'
]]]);
}
//当前权限允许的门店
if
(
isset
(
$params
[
'BRANCH_GUID'
])
&&
!
empty
(
$params
[
'BRANCH_GUID'
]))
{
$query
->
andFilterWhere
([
'or'
,[
'='
,
'ifnull(sb.SUPPROVINCE_GUID,cs.BRANCH_GUID)'
,
$params
[
'BRANCH_GUID'
]],[
'='
,
"ifnull(sb.PARENT_GUID,'')"
,
$params
[
'BRANCH_GUID'
]]]);
//$query->andWhere(['not', ['sg.GUID' => '']]);
$query
->
andWhere
([
'!='
,
'sg.GUID'
,
''
]);
}
//批量修改 条件
if
(
isset
(
$guid
)
&&
!
empty
(
$guid
)){
$query
->
andFilterWhere
([
'='
,
'cs.BRANCH_GUID'
,
$guid
]);
$query
->
and
Filter
Where
([
'!='
,
'sg.GUID'
,
''
]);
$query
->
andWhere
([
'!='
,
'sg.GUID'
,
''
]);
}
return
new
ActiveDataProvider
([
...
...
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