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
65007888
Commit
65007888
authored
Sep 15, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页附近的店铺
parent
91a4f6b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
GoodsClassService.php
application/models/Business/Goods/GoodsClassService.php
+5
-3
No files found.
application/models/Business/Goods/GoodsClassService.php
View file @
65007888
...
...
@@ -197,24 +197,26 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
foreach
(
$signStoreClasses
as
$signClass
){
$class_distance
=
\Our\CommonExtension
::
getDistance
(
$lat
,
$lng
,
$signClass
[
'latitude'
],
$signClass
[
'longitude'
],
1
);
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$class_distance
));
//判断签约分类是否可以为当前用户提供服务,并且记录这些店铺对应的store_id
if
(
$class_distance
<=
$signClass
[
'sign_rang'
]){
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$class_distance
));
$class
[
'class_distance'
]
=
$class_distance
;
$returnClass
[
$class_distance
]
=
$class
;
}
}
ksort
(
$returnClass
);
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$returnClass
));
$signParentClassIds
=
array_unique
(
array_column
(
$returnClass
,
'gc_parent_id'
));
$signStoreIds
=
array_unique
(
array_column
(
$returnClass
,
'store_id'
));
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$signStoreIds
));
//将当前位置对应签约店铺存入缓存
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
\Our\Log
::
getInstance
()
->
write
(
json_encode
(
$signStoreIds
));
if
(
$signStoreIds
){
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)));
$storeRedis
->
update
(
$signStoreKey
,
$signStoreIds
,
\Our\ApiConst
::
oneHour
);
...
...
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