Commit 90c49114 authored by clone's avatar clone

bug我的盘方

parent 2eb26475
......@@ -3,6 +3,7 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VerifyService;
use app\model\AttentionModel;
use app\model\GHouses;
use app\model\GHousesImgs;
......@@ -110,8 +111,12 @@ class Shop extends Basic
$conditions['shop_type'] = array( "eq", $params['shop_type'] );
}
//我的商铺 代表我是盘方的商铺
if(isset($params['agent_id'])){
$conditions['upload_id'] = array( "eq", $params['agent_id'] );
$verifyService = new VerifyService();
$ids = $verifyService->getPanpartyByAgentId($params['agent_id']);
//$conditions['upload_id'] = array( "eq", $params['agent_id'] );
$conditions['id'] = array("in",$ids);
}
$area_start = isset($params['shop_area_start']) ? $params['shop_area_start'] : -1;
......@@ -153,7 +158,8 @@ class Shop extends Basic
$conditions['is_show'] = array( 'eq', 0 ); //c端只显示可显示的楼盘
}
if( isset($conditions['upload_id'])){
//如果有传经纪人id则代表我的商铺不区分状态
if( isset($params['agent_id'])){
unset($conditions['status']);
}
$result = $this->gHousesModel->getHousesList($pageNo, $pageSize, $order_, $field, $conditions, $spTagArr);
......
......@@ -56,9 +56,14 @@ class VerifyService
return null;
}
/**
* 获取我的案场权限人
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public function getCaseHouseIdByAgentId($agent_id)
{
$houseToAgentModel = new GHousesToAgents();
$houseToAgentModel = new GHousesToAgents();
$params["a.agents_id"] = $agent_id;
$params["a.type"] = 1; //案场权限人
$params["a.is_del"] = 0;
......@@ -71,4 +76,29 @@ class VerifyService
return null;
}
/**
* 获取我的盘方
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public function getPanpartyByAgentId($agent_id)
{
$houseToAgentModel = new GHousesToAgents();
$params["a.agents_id"] = $agent_id;
$params["a.type"] = 2;
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
$ids = "";
if (count($house_arr) > 0) {
foreach ($house_arr as $item) {
$ids .= $item["houses_id"] . ",";
}
$ids = rtrim($ids, ",");
return $ids;
}
return null;
}
}
\ 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