Commit 604c6e6d authored by zhuwei's avatar zhuwei

1

parent 19f5f0f7
...@@ -44,7 +44,7 @@ class OfficeRoom extends Basic ...@@ -44,7 +44,7 @@ class OfficeRoom extends Basic
} }
$id = $params['id']; $id = $params['id'];
$result = $this->service->getOfficeRoomInfo($id,1,1); $result = $this->service->getOfficeRoomInfo($id,$this->userId,1);
return $this->response($result['status'],$result['msg'], $result['data']); return $this->response($result['status'],$result['msg'], $result['data']);
} }
......
...@@ -13,6 +13,7 @@ use app\api_broker\service\PushMessageService; ...@@ -13,6 +13,7 @@ use app\api_broker\service\PushMessageService;
use app\api_broker\service\RedisCacheService; use app\api_broker\service\RedisCacheService;
use app\index\validate\OfficeBuildingRoomValidate; use app\index\validate\OfficeBuildingRoomValidate;
use app\model\AAgents; use app\model\AAgents;
use app\model\AttentionModel;
use app\model\GBusinessDistrict; use app\model\GBusinessDistrict;
use app\model\OfficeACollectHouse; use app\model\OfficeACollectHouse;
use app\model\OfficeGBuilding; use app\model\OfficeGBuilding;
...@@ -703,7 +704,7 @@ class OfficeRoomService ...@@ -703,7 +704,7 @@ class OfficeRoomService
//楼盘图 //楼盘图
$result['building_image'] = $this->getBuildingImage($result['building_id']); $result['building_image'] = $this->getBuildingImage($result['building_id']);
//是否被收藏 //是否被收藏
$result['is_collect'] = $this->isCollect($result['id'], $agent_id); $result['is_collect'] = $this->isCollect($result['id'], $agent_id,$type);
//是否可编辑 //是否可编辑
$result['is_can_edit'] = $this->isCanEdit($result['id'], $agent_id); $result['is_can_edit'] = $this->isCanEdit($result['id'], $agent_id);
//微信分享图 原来的随机图 //微信分享图 原来的随机图
...@@ -731,8 +732,11 @@ class OfficeRoomService ...@@ -731,8 +732,11 @@ class OfficeRoomService
//是否被收藏 //是否被收藏
private function isCollect($house_id, $agent_id) private function isCollect($house_id, $agent_id,$type)
{ {
if($type == 1){
$is_collect = $this->isCollectToC($house_id,$agent_id);
}else{
$m_collect_room = new OfficeACollectHouse(); $m_collect_room = new OfficeACollectHouse();
//是否被收藏 //是否被收藏
$is_collect = 2; $is_collect = 2;
...@@ -746,6 +750,24 @@ class OfficeRoomService ...@@ -746,6 +750,24 @@ class OfficeRoomService
$is_collect = 1; $is_collect = 1;
} }
} }
}
return $is_collect;
}
//C是否被收藏
private function isCollectToC($house_id,$user_id){
$m_attention = new AttentionModel();
$attention["user_id"] = array("eq", $user_id);
$attention["house_id"] = array("eq", $house_id);
$attention["is_del"] = array("eq", 0);
$attention["type"] = array("eq", 1);
$attResult = $m_attention->getAttentionByUserIdAndHouseId($attention);
$is_collect = 0;
if (count($attResult) > 0)
$is_collect = $attResult[0]['id'];
return $is_collect; return $is_collect;
} }
......
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