Commit 242e36b2 authored by liuyuzhen's avatar liuyuzhen

经纬度信息调整

parent 4daa83ec
......@@ -174,9 +174,9 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$position['lat'] = $where['lat'];
$position['lng'] = $where['lng'];
$position['cityCode'] = $where['cityCode'];
ksort($position);
$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);
return $serviceStoreIds;
}
......@@ -217,9 +217,10 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$position['lat'] = $where['lat'];
$position['lng'] = $where['lng'];
$position['cityCode'] = $where['cityCode'];
ksort($position);
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
if($signStoreIds){
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize(ksort($position)));
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize($position));
$storeRedis->update($signStoreKey,$signStoreIds,\Our\ApiConst::oneHour);
}
return array(
......
......@@ -711,8 +711,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
public function getAllNearbyGoods($position){
$redisSuffix = crc32(serialize(ksort($position)));
ksort($position);
$redisSuffix = crc32(serialize($position));
$nearbyStoreKey = \Our\NameConst::nearbyStoreKeyPrefix . $redisSuffix;
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
......@@ -752,7 +752,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$position['lat'] = $where['lat'];
$position['lng'] = $where['lng'];
$position['cityCode'] = $where['cityCode'];
$redisSuffix = crc32(serialize(ksort($position)));
ksort($position);
$redisSuffix = crc32(serialize($position));
$nearbyGoodsListKey = \Our\NameConst::nearbyStoreGoodsPrefix . $redisSuffix;
......
......@@ -399,8 +399,8 @@ class StoreServiceModel extends \Business\AbstractModel{
$position['lat'] = $where['lat'];
$position['lng'] = $where['lng'];
$position['cityCode'] = $where['cityCode'];
$readisSuffix = crc32(serialize(ksort($position)));
ksort($position);
$readisSuffix = crc32(serialize($position));
$nearbyStoreIds = $this->getNearbyStoreIds($position);
//没有得到任何附近的店铺
if(!$nearbyStoreIds){
......@@ -452,7 +452,8 @@ class StoreServiceModel extends \Business\AbstractModel{
* @param $position
*/
private function getNearbyStoreIds($position){
$readisSuffix = crc32(serialize(ksort($position)));
ksort($position);
$readisSuffix = crc32(serialize($position));
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
$signStoreKey = \Our\NameConst::signStoreIdsPrefix . $readisSuffix;
$signStoreIds =$storeRedis->find($signStoreKey, \Our\ApiConst::oneHour);
......@@ -489,7 +490,8 @@ class StoreServiceModel extends \Business\AbstractModel{
$position['lat'] = $where['lat'];
$position['lng'] = $where['lng'];
$position['cityCode'] = $where['cityCode'];
$readisSuffix = crc32(serialize(ksort($position)));
ksort($position);
$readisSuffix = crc32(serialize($position));
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
$nearbyStoreKey = \Our\NameConst::nearbyStoreKeyPrefix . $readisSuffix;
......@@ -623,10 +625,10 @@ class StoreServiceModel extends \Business\AbstractModel{
* @param $position
*/
public function getSignClassStores($gcId,$position){
ksort($position);
//第一步:获取当前地址对应店铺是否包含当前分类(签约)
$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);
//签约店铺存在
if($signStoreIds){
......@@ -643,10 +645,10 @@ class StoreServiceModel extends \Business\AbstractModel{
* @return array|bool
*/
public function getServiceClassStores($gcId,$position){
ksort($position);
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize(ksort($position)));
$serviceStoreKey = \Our\NameConst::serviceStoreIdsPrefix.crc32(serialize(ksort($position)));
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize($position));
$serviceStoreKey = \Our\NameConst::serviceStoreIdsPrefix.crc32(serialize($position));
$signStoreIds = $storeRedis->find($signStoreKey, \Our\ApiConst::oneHour);
$serviceStoreIds = $storeRedis->find($serviceStoreKey, \Our\ApiConst::oneHour);
if($signStoreIds&&$serviceStoreIds){
......@@ -661,10 +663,11 @@ class StoreServiceModel extends \Business\AbstractModel{
}
public function getExpressStores($gcId,$position){
ksort($position);
$storeDao = \DAO\StoreModel::getInstance();
$storeRedis = \Redis\Db6\StoreRedisModel::getInstance();
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize(ksort($position)));
$serviceStoreKey = \Our\NameConst::serviceStoreIdsPrefix.crc32(serialize(ksort($position)));
$signStoreKey = \Our\NameConst::signStoreIdsPrefix.crc32(serialize($position));
$serviceStoreKey = \Our\NameConst::serviceStoreIdsPrefix.crc32(serialize($position));
$signStoreIds = $storeRedis->find($signStoreKey, \Our\ApiConst::oneHour);
$serviceStoreIds = $storeRedis->find($serviceStoreKey, \Our\ApiConst::oneHour);
$expressStores = $storeDao->getExpressStores('store_id');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment