Commit c3809c9e authored by zhuwei's avatar zhuwei

客户城市标签

parent 812e2ec7
...@@ -181,7 +181,8 @@ class ImageDepot extends Basic ...@@ -181,7 +181,8 @@ class ImageDepot extends Basic
// $res = $s_user_agent->moveHouse(); // $res = $s_user_agent->moveHouse();
$s = new UserSiteService(); $s = new UserSiteService();
$res = $s->moveUserSite(); // $res = $s->moveUserSite();
$res = $s->getSiteNameList(135573);
// dump($res); // dump($res);
} }
......
...@@ -8,6 +8,7 @@ use app\api_broker\service\RedisCacheService; ...@@ -8,6 +8,7 @@ use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService; use app\api_broker\service\VipService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\BrokerService; use app\index\service\BrokerService;
use app\index\service\UserAgentService;
use app\index\service\UserService; use app\index\service\UserService;
use app\model\AAgents; use app\model\AAgents;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
......
...@@ -129,4 +129,27 @@ class UserSiteService ...@@ -129,4 +129,27 @@ class UserSiteService
} }
/**
* 客户城市标签
* @param $user_id
* @return string
*/
public function getSiteNameList($user_id)
{
//查询总监下面门店的所有经纪人
$params = [];
$params["a.user_id"] = $user_id;
$field = 'b.city';
$res = $this->m_user_site->getSiteNameList($field, $params);
$list_str = "";
if (count($res) > 0) {
foreach ($res as $k => $v) {
$list_str .= $v["city"] . ",";
}
$list_str = rtrim($list_str, ",");
}
return $list_str;
}
} }
\ No newline at end of file
...@@ -37,9 +37,9 @@ class UserSiteModel extends Model ...@@ -37,9 +37,9 @@ class UserSiteModel extends Model
return $result; return $result;
} }
// /** /**
// * 查询数据 * 查询数据
// */ */
public function getUserSite($field,$params) public function getUserSite($field,$params)
{ {
$result = $this->db_ $result = $this->db_
...@@ -49,21 +49,6 @@ class UserSiteModel extends Model ...@@ -49,21 +49,6 @@ class UserSiteModel extends Model
//echo $this->getLastSql(); //echo $this->getLastSql();
return $result; return $result;
} }
//
// public function selectUserAgent($field,$params)
// {
// $params["a.is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->join('a_site d', 'a.site_id = d.id', 'left')
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
/** /**
* 更新数据 * 更新数据
...@@ -75,59 +60,19 @@ class UserSiteModel extends Model ...@@ -75,59 +60,19 @@ class UserSiteModel extends Model
return $result; return $result;
} }
//
// /**
// * @param $field public function getSiteNameList($field,$params)
// * @param $params {
// * @return array $params["a.is_del"] = 0;
// */ $result = $this->db_
// public function getUserAgentColumn($field, $params) { ->field($field)
// $params['is_del'] = 0; ->alias('a')
// return $this->db_->where($params) ->join('a_site b', 'a.site_id = b.id', 'left')
// ->column($field); ->where($params)
// } ->select();
// //echo $this->getLastSql();
// /** return $result;
// * 统计客方 }
// * @param $params
// * @return false|\PDOStatement|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// */
// public function getAddUserNumGroupTimeNew($params)
// {
// $field = "count(1) as num";
// $where_['is_del'] = 0;
// if (isset($params["agent_id"])) {
// $where_["agent_id"] = $params["agent_id"];
// }
// if (isset($params["create_time"])) {
// $where_["create_time"] = $params["create_time"];
// }
// return $this->db_
// ->field($field)
// ->where($where_)
// ->select();
// }
//
// public function moveHouseInsertAll($data)
// {
// $result = Db::table($this->table)
// ->insertAll($data);
// return $result;
// }
//
// /**
// * @param $field
// * @param $where
// * @return false|\PDOStatement|string|\think\Collection
// */
// public function getAllData($field, $where)
// {
// $where['is_del'] = 0;
// return $this->db_->field($field)
// ->where($where)
// ->select();
// }
} }
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