Commit 009952b5 authored by zhuwei's avatar zhuwei

bug

parent 9f61329b
...@@ -25,6 +25,7 @@ use app\model\NoteLog; ...@@ -25,6 +25,7 @@ use app\model\NoteLog;
use app\model\UPhoneFollowPp; use app\model\UPhoneFollowPp;
use app\model\Users; use app\model\Users;
use think\Exception; use think\Exception;
use think\Log;
use think\Request; use think\Request;
class Broker extends Basic class Broker extends Basic
...@@ -422,6 +423,8 @@ class Broker extends Basic ...@@ -422,6 +423,8 @@ class Broker extends Basic
$user = new Users(); $user = new Users();
$user_res = $user->useraction_search_user_res($user_id, 1); $user_res = $user->useraction_search_user_res($user_id, 1);
Log::write(json_encode($user_res), '客户详情'); //记录日志
$user_res['user_pic'] = HEADERIMGURL . $user_res['user_pic']; $user_res['user_pic'] = HEADERIMGURL . $user_res['user_pic'];
...@@ -462,7 +465,7 @@ class Broker extends Basic ...@@ -462,7 +465,7 @@ class Broker extends Basic
//$res = $ser->getExpiredTimeByUser($v["user_id"]); //$res = $ser->getExpiredTimeByUser($v["user_id"]);
//$data['data']['list'][$k]['is_outstrip_twenty_four_hours'] = $res ? 0 : 1 ; //$data['data']['list'][$k]['is_outstrip_twenty_four_hours'] = $res ? 0 : 1 ;
$is_outstrip_twenty_four_hours = 0; $is_outstrip_twenty_four_hours = 0;
if ((time() - strtotime($user_res['u_create_time'])) > (60 * 60 * 24)) { if ((time() - strtotime($user_res['create_time'])) > (60 * 60 * 24)) {
$is_outstrip_twenty_four_hours = 1; $is_outstrip_twenty_four_hours = 1;
} }
$data['is_outstrip_twenty_four_hours'] = $is_outstrip_twenty_four_hours; $data['is_outstrip_twenty_four_hours'] = $is_outstrip_twenty_four_hours;
......
...@@ -142,14 +142,12 @@ class LookShop extends Basic ...@@ -142,14 +142,12 @@ class LookShop extends Basic
$lookNum = $data["agent_shop_num"]; $lookNum = $data["agent_shop_num"];
} }
//todo 1.返回剩余铺数等于多少 if 0 判断是否升级过 ,升级过 显示已升级,没升级过 升级可以点击效果 else 不等于0 灰色的升级 //1.返回剩余铺数等于多少 if 0 判断是否升级过 ,升级过 显示已升级,没升级过 升级可以点击效果 else 不等于0 灰色的升级
foreach ($agentList as $key => $item) { foreach ($agentList as $key => $item) {
Log::write($item["id"], '看铺经纪人ID'); //记录日志
$can_look_num = $this->lookShopService_->isLookShop($item["id"]); $can_look_num = $this->lookShopService_->isLookShop($item["id"]);
$is_upgrade = $this->lookShopService_->getAgentUpNum($item["id"]); $is_upgrade = $this->lookShopService_->getAgentUpNum($item["id"]);
$agentList[$key]["can_look_num"] = $can_look_num; $agentList[$key]["can_look_num"] = $can_look_num;
$agentList[$key]["is_upgrade"] = $is_upgrade;//等于1 升级过 0 没有 $agentList[$key]["is_upgrade"] = $is_upgrade == 1 ? false : true ;//前端判断 等于1是未升级 2已升级
} }
$result["look_num"] = $lookNum; $result["look_num"] = $lookNum;
$result["list"] = $agentList; $result["list"] = $agentList;
......
...@@ -183,7 +183,7 @@ class LookShopService ...@@ -183,7 +183,7 @@ class LookShopService
return false; return false;
} }
$agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id); $agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id);
if($agentUpNum >= 1){ if($agentUpNum >= 2){
return false; return false;
} }
$upLookNum = (int)$agentUpNum + 1; $upLookNum = (int)$agentUpNum + 1;
...@@ -191,11 +191,15 @@ class LookShopService ...@@ -191,11 +191,15 @@ class LookShopService
return true; return true;
} }
public function getAgentUpNum(int $agent_id): bool /**
* 查询经纪人升级次数
* @param int $agent_id
* @return int
*/
public function getAgentUpNum(int $agent_id): int
{ {
$agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id); $agentUpNum = $this->redis->hGet(self::LOOK_UP_NUM . $this->nowTime, $agent_id);
return $agentUpNum; return $agentUpNum;
} }
......
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