Commit e23309ac authored by zhuwei's avatar zhuwei

经纪人转勤账号

parent 0d9f5a10
......@@ -198,18 +198,13 @@ class Shop extends Basic
//我的商铺 代表我是盘方的商铺
if (isset($params['agent_id'])) {
big_log($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);
if(empty($params["city"])){
$conditions["city"] = trim($this->city);
}else{
if(!empty($params["city"])){
$conditions["city"] = $params["city"];
}
big_log($params);
}
$area_start = isset($params['shop_area_start']) ? $params['shop_area_start'] : -1;
......@@ -285,6 +280,7 @@ class Shop extends Basic
//$conditions['status'] = array( 'in', "1,2" ); //只显示上架或下架的
$conditions['status'] = !empty($params['status']) ? $params['status'] : array('in', "1,2"); //只显示上架或下架的
}
$result = $this->gHousesModel->getHousesList($pageNo, $pageSize, $order_, $field, $conditions, $spTagArr);
// $m_business_district = new GBusinessDistrict();
......
......@@ -414,16 +414,49 @@ class UserLogService
{
$is_collect = 2;
$collect_house = new ACollectUser();
$insert["agents_id"] = $agent_id;
$insert["user_id"] = $user_id;
$insert["status"] = 1;
$is_saved = $collect_house->getCollectUser('id',$insert);
if($is_saved){
$agent_ids = $this->getSiteAgentId($agent_id);
if ($agent_ids) {
//此经纪人有转勤账号
$insert["agents_id"] = array( 'in', $agent_ids );
} else {
$insert["agents_id"] = $agent_id;
}
$insert["user_id"] = $user_id;
$insert["status"] = 1;
$is_saved = $collect_house->getCollectUser('id', $insert);
if ($is_saved) {
$is_collect = 1;
}
return $is_collect;
}
/**
* 获取经纪人所有站点账号
* @param $agent_id
* @return string
*/
public function getSiteAgentId($agent_id)
{
$m_agent = new AAgents();
$agent_phone = $m_agent->getAgentsById($agent_id, 'phone');
$params = [];
$params["phone"] = $agent_phone;
$params["status"] = array( 'in', '0,3' );
$agentsArr = $m_agent->getAgentsByStoreId($params);
$agent_total = count($agentsArr);
$agent_ids = "";
if ($agent_total > 0) {
foreach ($agentsArr as $key1 => $value1) {
$agent_ids .= $value1["id"] . ",";
}
$agent_ids = rtrim($agent_ids, ",");//经纪人ID集合
}
return $agent_ids;
}
/**
* 判断当天被拨打是否超过5次
......
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