Commit 91a4f6b3 authored by liuyuzhen's avatar liuyuzhen

首页附近的店铺

parent fa9432b3
......@@ -191,11 +191,14 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$signStoreClasses = $this->getSignClassesByCityCode($cityCode);
\Our\Log::getInstance()->write(json_encode($signStoreClasses));
if($signStoreClasses){
$returnClass = array();
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']){
$class['class_distance'] = $class_distance;
......@@ -211,6 +214,7 @@ class GoodsClassServiceModel extends \Business\AbstractModel{
$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);
......
......@@ -89,6 +89,7 @@ class QmStoreClassModel extends \DAO\AbstractModel{
public function getStoreClasses($where, $field = '*'){
$this->setDb();
$result = $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
\Our\Log::getInstance()->write($this->db->getLastSql());
return $result;
}
......
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