Commit f6427d26 authored by zhuwei's avatar zhuwei

1

parent 3c5daea3
......@@ -15,6 +15,7 @@ use app\model\GOperatingRecords;
use app\model\ULabels;
use app\model\UPhoneFollowPp;
use app\model\UPhoneFollowUp;
use app\model\UserAgentModel;
use app\model\Users;
use think\Log;
use think\Request;
......@@ -139,7 +140,13 @@ class User extends Basic
break;
case 2:
$conditions['agent_id'] = $params['agent_id'];
$user_id_str = $this->getUserIDList($params['agent_id']);
if($user_id_str){
$conditions['agent_id'] = array('in',$user_id_str);
}else{
$conditions['agent_id'] = $params['agent_id'];
}
if (isset($params['user_status'])) {
$conditions['user_status'] = $params['user_status'];
}
......@@ -878,5 +885,26 @@ class User extends Basic
}
public function getUserIDList($agent_id)
{
//查询总监下面门店的所有经纪人
$params = [];
$params["agent_id"] = $agent_id;
$params["is_del"] = 0;
$m_user_agent = new UserAgentModel();
$field = 'user_id';
$res = $m_user_agent->selectUser($field,$params);
$user_id_str = "";
if (count($res) > 0) {
foreach ($res as $k => $v) {
$user_id_str .= $v["user_id"] . ",";
}
$user_id_str = rtrim($user_id_str, ",");
}
return $user_id_str;
}
}
\ No newline at end of file
......@@ -56,6 +56,17 @@ class UserAgentModel extends Model
//echo $this->getLastSql();
return $result;
}
public function selectUser($field,$params)
{
$params["is_del"] = 0;
$result = $this->db_
->field($field)
->where($params)
->select();
//echo $this->getLastSql();
return $result;
}
/**
* 更新数据
*/
......
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