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
242e36b2
Commit
242e36b2
authored
Sep 27, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纬度信息调整
parent
4daa83ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
17 deletions
+22
-17
GoodsClassService.php
application/models/Business/Goods/GoodsClassService.php
+4
-3
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+4
-3
StoreService.php
application/models/Business/Store/StoreService.php
+14
-11
No files found.
application/models/Business/Goods/GoodsClassService.php
View file @
242e36b2
...
@@ -174,9 +174,9 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
...
@@ -174,9 +174,9 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
ksort
(
$position
);
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$storeRedis
->
update
(
$serviceStoreKey
,
$serviceStoreIds
,
\Our\ApiConst
::
oneHour
);
$storeRedis
->
update
(
$serviceStoreKey
,
$serviceStoreIds
,
\Our\ApiConst
::
oneHour
);
return
$serviceStoreIds
;
return
$serviceStoreIds
;
}
}
...
@@ -217,9 +217,10 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
...
@@ -217,9 +217,10 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
ksort
(
$position
);
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
if
(
$signStoreIds
){
if
(
$signStoreIds
){
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$storeRedis
->
update
(
$signStoreKey
,
$signStoreIds
,
\Our\ApiConst
::
oneHour
);
$storeRedis
->
update
(
$signStoreKey
,
$signStoreIds
,
\Our\ApiConst
::
oneHour
);
}
}
return
array
(
return
array
(
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
242e36b2
...
@@ -711,8 +711,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -711,8 +711,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
public
function
getAllNearbyGoods
(
$position
){
public
function
getAllNearbyGoods
(
$position
){
ksort
(
$position
);
$redisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)
));
$redisSuffix
=
crc32
(
serialize
(
$position
));
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$redisSuffix
;
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$redisSuffix
;
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
...
@@ -752,7 +752,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -752,7 +752,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$redisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)));
ksort
(
$position
);
$redisSuffix
=
crc32
(
serialize
(
$position
));
$nearbyGoodsListKey
=
\Our\NameConst
::
nearbyStoreGoodsPrefix
.
$redisSuffix
;
$nearbyGoodsListKey
=
\Our\NameConst
::
nearbyStoreGoodsPrefix
.
$redisSuffix
;
...
...
application/models/Business/Store/StoreService.php
View file @
242e36b2
...
@@ -399,8 +399,8 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -399,8 +399,8 @@ class StoreServiceModel extends \Business\AbstractModel{
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$readisSuffix
=
crc32
(
serialize
(
ksort
(
$position
))
);
ksort
(
$position
);
$readisSuffix
=
crc32
(
serialize
(
$position
));
$nearbyStoreIds
=
$this
->
getNearbyStoreIds
(
$position
);
$nearbyStoreIds
=
$this
->
getNearbyStoreIds
(
$position
);
//没有得到任何附近的店铺
//没有得到任何附近的店铺
if
(
!
$nearbyStoreIds
){
if
(
!
$nearbyStoreIds
){
...
@@ -452,7 +452,8 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -452,7 +452,8 @@ class StoreServiceModel extends \Business\AbstractModel{
* @param $position
* @param $position
*/
*/
private
function
getNearbyStoreIds
(
$position
){
private
function
getNearbyStoreIds
(
$position
){
$readisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)));
ksort
(
$position
);
$readisSuffix
=
crc32
(
serialize
(
$position
));
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
$readisSuffix
;
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
$readisSuffix
;
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
...
@@ -489,7 +490,8 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -489,7 +490,8 @@ class StoreServiceModel extends \Business\AbstractModel{
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lat'
]
=
$where
[
'lat'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'lng'
]
=
$where
[
'lng'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$position
[
'cityCode'
]
=
$where
[
'cityCode'
];
$readisSuffix
=
crc32
(
serialize
(
ksort
(
$position
)));
ksort
(
$position
);
$readisSuffix
=
crc32
(
serialize
(
$position
));
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$readisSuffix
;
$nearbyStoreKey
=
\Our\NameConst
::
nearbyStoreKeyPrefix
.
$readisSuffix
;
...
@@ -623,10 +625,10 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -623,10 +625,10 @@ class StoreServiceModel extends \Business\AbstractModel{
* @param $position
* @param $position
*/
*/
public
function
getSignClassStores
(
$gcId
,
$position
){
public
function
getSignClassStores
(
$gcId
,
$position
){
ksort
(
$position
);
//第一步:获取当前地址对应店铺是否包含当前分类(签约)
//第一步:获取当前地址对应店铺是否包含当前分类(签约)
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
//签约店铺存在
//签约店铺存在
if
(
$signStoreIds
){
if
(
$signStoreIds
){
...
@@ -643,10 +645,10 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -643,10 +645,10 @@ class StoreServiceModel extends \Business\AbstractModel{
* @return array|bool
* @return array|bool
*/
*/
public
function
getServiceClassStores
(
$gcId
,
$position
){
public
function
getServiceClassStores
(
$gcId
,
$position
){
ksort
(
$position
);
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$serviceStoreIds
=
$storeRedis
->
find
(
$serviceStoreKey
,
\Our\ApiConst
::
oneHour
);
$serviceStoreIds
=
$storeRedis
->
find
(
$serviceStoreKey
,
\Our\ApiConst
::
oneHour
);
if
(
$signStoreIds
&&
$serviceStoreIds
){
if
(
$signStoreIds
&&
$serviceStoreIds
){
...
@@ -661,10 +663,11 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -661,10 +663,11 @@ class StoreServiceModel extends \Business\AbstractModel{
}
}
public
function
getExpressStores
(
$gcId
,
$position
){
public
function
getExpressStores
(
$gcId
,
$position
){
ksort
(
$position
);
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$storeRedis
=
\Redis\Db6\StoreRedisModel
::
getInstance
();
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$signStoreKey
=
\Our\NameConst
::
signStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
ksort
(
$position
)
));
$serviceStoreKey
=
\Our\NameConst
::
serviceStoreIdsPrefix
.
crc32
(
serialize
(
$position
));
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$signStoreIds
=
$storeRedis
->
find
(
$signStoreKey
,
\Our\ApiConst
::
oneHour
);
$serviceStoreIds
=
$storeRedis
->
find
(
$serviceStoreKey
,
\Our\ApiConst
::
oneHour
);
$serviceStoreIds
=
$storeRedis
->
find
(
$serviceStoreKey
,
\Our\ApiConst
::
oneHour
);
$expressStores
=
$storeDao
->
getExpressStores
(
'store_id'
);
$expressStores
=
$storeDao
->
getExpressStores
(
'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