Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
chenchuanwen
my-yaf-project
Commits
7e90e566
Commit
7e90e566
authored
Nov 14, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页优化
parent
75b74f8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
StoreUtil.php
application/library/Store/StoreUtil.php
+28
-0
GoodsClassService.php
application/models/Business/Goods/GoodsClassService.php
+5
-1
No files found.
application/library/Store/StoreUtil.php
View file @
7e90e566
...
...
@@ -9,6 +9,34 @@ namespace Store;
class
StoreUtil
{
public
function
checkAddressInServiceAreaByStore
(
$address
,
$store
){
$storeDao
=
\DAO\StoreModel
::
getInstance
();
//$store = $storeDao->get($storeId,false);
$storeId
=
$store
[
'store_id'
]
$inAreaFlag
=
false
;
$qmStoreClassDao
=
\DAO\QmStoreClassModel
::
getInstance
();
$qmClassCon
[
'store_id'
]
=
$storeId
;
$qmClassCon
[
'is_charged'
]
=
1
;
$qmClassCon
[
'class_style'
]
=
2
;
$qmSignScopeList
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db6\QmStoreClassRedisModel
::
getInstance
(),
array
(
&
$qmStoreClassDao
,
'selectByWhere'
),
array
(
$qmClassCon
,
'sign_scope'
),
\Our\ApiConst
::
oneHour
,
array
(
$storeId
));
if
(
$qmSignScopeList
){
foreach
(
$qmSignScopeList
as
$qmSignScope
){
if
(
$qmSignScope
[
'sign_scope'
]){
$inAreaFlag
=
\Our\CommonExtension
::
locationInArea
(
$address
[
'lat'
],
$address
[
'lng'
],
$qmSignScope
[
'sign_scope'
]);
if
(
$inAreaFlag
){
return
true
;
}
}
}
}
if
(
!
$store
[
'store_sales_scope'
]){
return
false
;
}
$inAreaFlag
=
\Our\CommonExtension
::
locationInArea
(
$address
[
'lat'
],
$address
[
'lng'
],
$store
[
'store_sales_scope'
]);
return
$inAreaFlag
;
}
public
function
checkAddressInServiceArea
(
$address
,
$storeId
){
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$store
=
$storeDao
->
get
(
$storeId
,
false
);
...
...
application/models/Business/Goods/GoodsClassService.php
View file @
7e90e566
...
...
@@ -157,10 +157,14 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$storeList
=
$storeDao
->
getStoresByCityCode
(
$where
[
'cityCode'
]);
$storeIndexList
=
array
();
foreach
(
$storeList
as
$tempStore
){
$storeIndexList
[
$tempStore
[
'store_id'
]]
=
$tempStore
;
}
$serviceStoreIds
=
array
();
if
(
$storeList
){
foreach
(
$storeList
as
$key
=>
$store
){
$result
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
(
array
(
'lng'
=>
$where
[
'lng'
],
'lat'
=>
$where
[
'lat'
]),
$store
[
'store_id'
]);
$result
=
\Store\StoreUtil
::
getInstance
()
->
checkAddressInServiceArea
ByStore
(
array
(
'lng'
=>
$where
[
'lng'
],
'lat'
=>
$where
[
'lat'
]),
$storeIndexList
[
$tempStore
[
'store_id'
]
]);
if
(
$result
){
$serviceStoreIds
[]
=
$store
[
'store_id'
];
}
...
...
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