Commit 3d3083c6 authored by zw's avatar zw

看铺数量控制

parent 0cc68515
...@@ -10,6 +10,7 @@ use app\model\GHouses; ...@@ -10,6 +10,7 @@ use app\model\GHouses;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\Regions; use app\model\Regions;
use think\Log;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -30,6 +31,8 @@ class Shop extends Basic ...@@ -30,6 +31,8 @@ class Shop extends Basic
$this->gHousesModel = new GHouses(); $this->gHousesModel = new GHouses();
$this->gHousesImgModel = new GHousesImgs(); $this->gHousesImgModel = new GHousesImgs();
$this->attentionModel = new AttentionModel(); $this->attentionModel = new AttentionModel();
Log::record('info ----shop---------' . $this->agentId, "info");
} }
/** /**
...@@ -210,7 +213,9 @@ class Shop extends Basic ...@@ -210,7 +213,9 @@ class Shop extends Basic
$lookShopService_ = new LookShopService(); $lookShopService_ = new LookShopService();
//todo 判断看铺数量是否上限 //todo 判断看铺数量是否上限
if($lookShopService_->isLookShop($this->agentId) == 0){
Log::record('info ----shopdetail-------' . $this->agentId, "info");
if($lookShopService_->isLookShop((int)$this->agentId) == 0){
return $this->response("101", "您今天的看铺数量已达上限!"); return $this->response("101", "您今天的看铺数量已达上限!");
} }
...@@ -276,7 +281,7 @@ class Shop extends Basic ...@@ -276,7 +281,7 @@ class Shop extends Basic
$result["panParty"] = $agentId; $result["panParty"] = $agentId;
//todo 计数开始 //todo 计数开始
if($params["site_area"] == 3 && $result){ if($params["site_area"] == 3 && $result){
$lookShopArr = $lookShopService_->countLookShopNum($this->agentId,$params["id"]); $lookShopArr = $lookShopService_->countLookShopNum((int)$this->agentId,(int)$params["id"]);
$result["lookShopArr"] = $lookShopArr; $result["lookShopArr"] = $lookShopArr;
} }
return $this->response("200", 'request success', $result); return $this->response("200", 'request success', $result);
......
...@@ -65,7 +65,7 @@ class LookShopService ...@@ -65,7 +65,7 @@ class LookShopService
$lookNum = 5;//数据库查询 $lookNum = 5;//数据库查询
$this->redis->set("lookNum", $lookNum); $this->redis->set("lookNum", $lookNum);
} }
if (!$this->redis->hGet($this->nowTime, $agent_id)) { //设置每个经纪人的看铺总数 if (!$this->redis->hExists($this->nowTime, $agent_id)) { //设置每个经纪人的看铺总数
$this->redis->hSet($this->nowTime, $agent_id, 0); //开始计数 $this->redis->hSet($this->nowTime, $agent_id, 0); //开始计数
$this->redis->hSet(self::LOOK_TOTAL . $this->nowTime, $agent_id, $lookNum);//总数 $this->redis->hSet(self::LOOK_TOTAL . $this->nowTime, $agent_id, $lookNum);//总数
} }
......
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