Commit 08ebc110 authored by zw's avatar zw

bug

parent 41ea3703
......@@ -26,6 +26,7 @@ class LookShopService
private $systemConfigModel;
const LOOK_SHOP = "look_shop_";//存入已看的楼盘id
const LOOK_TOTAL = "look_total_";//记录每个经纪人的看铺总数
const LOOK_UP_NUM = "look_up_num_";//记录每个经纪人的看铺升级次数
public function __construct()
{
......@@ -149,10 +150,10 @@ class LookShopService
if (!$this->redis->hExists($this->nowTime, $agent_id)) { //设置每个经纪人的看铺总数
$this->redis->hSet($this->nowTime, $agent_id, 0); //开始计数
$this->redis->hSet(self::LOOK_TOTAL . $this->nowTime, $agent_id, $lookNum);//总
$this->redis->hSet(self::LOOK_UP_NUM . $this->nowTime, $agent_id, 1);//初始次
}
$agentLookNum = (int)$this->redis->hGet($this->nowTime, $agent_id);
$totalNum = (int)$this->redis->hGet(self::LOOK_TOTAL . $this->nowTime, $agent_id);
$totalNum = $lookNum * (int)$this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id);
Log::record('info ----look agentLookNum-------' . $agentLookNum, "info");
Log::record('info ----look totalNum-------' . $totalNum, "info");
if ($agentLookNum >= $totalNum) { //如果数量为大于等于总数 证明看铺达到上限
......@@ -176,7 +177,7 @@ class LookShopService
}
/**
* 升级经纪人看铺数量
* 升级经纪人看铺次数
* @param int $agent_id
* @return bool
*/
......@@ -185,10 +186,9 @@ class LookShopService
if(!$this->redis){
return false;
}
$agentNum = $this->redis->hGet(self::LOOK_TOTAL . $this->nowTime, $agent_id);
$lookNum = $this->redis->get("lookNum");
$upLookNum = (int)$lookNum + (int)$agentNum;
$this->redis->hSet(self::LOOK_TOTAL . $this->nowTime, $agent_id, $upLookNum);
$agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id);
$upLookNum = (int)$agentUpNum + 1;
$this->redis->hSet(self::LOOK_UP_NUM . $this->nowTime, $agent_id, $upLookNum);
return true;
}
}
\ No newline at end of file
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