Commit e3e860dc authored by hujun's avatar hujun

客户列表搜索

parent 86ee5458
......@@ -150,6 +150,41 @@ class Member extends Basic{
$type = 2;
}
//业态
if (!empty($params['industry_type'])) {
$where['a.industry_type'] = $params['industry_type'];
}
//面积需求
if (!empty($params['area_type'])) {
switch ($params['area_type']) {
case 1 :
$where['a.area_demand'] = ['<=', 100];break;
case 2 :
$where['a.area_demand'] = ['between', [100,500]];break;
default :
$where['a.area_demand'] = ['>', 500];
}
}
//价格需求
if (!empty($params['price_type'])) {
switch ($params['price_type']) {
case 1 :
$where['a.price_demand'] = ['<=', 10000];break;
case 2 :
$where['a.price_demand'] = ['between', [10000,30000]];break;
default :
$where['a.price_demand'] = ['>', 30000];
}
}
if (!empty($params['invite_agent_phone'])) {
$type = 4;
$where['b.phone'] = $params['invite_agent_phone'];
}
/* //最后登录开始时间
if (!empty($params['login_time_start']) && empty($params['login_time_end'])) {
$where['a.last_login_time'] = ['> time',$params['last_login_time']. ' 00:00:00'];
......
......@@ -95,6 +95,16 @@ class Users extends Model
->limit($pageSize)
->page($pageNo)
->select();
} elseif ($type == 4) {
$result = $this->field($fields)
->alias('a')
->join('a_agents b', 'a.referrer_id = b.id', 'left')
->where($params)
->where('a.referrer_source', 20)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
} else {
$result = $this->field($fields)->alias('a')
->where($params)
......@@ -150,6 +160,12 @@ class Users extends Model
->join('a_agents b', 'a.agent_id = b.id', 'left')
->where($params)
->count();
} elseif ($type == 4) {
$result = $this->alias('a')
->join('a_agents b', 'a.referrer_id = b.id', 'left')
->where($params)
->where('a.referrer_source', 20)
->select();
} else {
$result = $this->alias('a')
->where($params)
......@@ -308,7 +324,7 @@ class Users extends Model
public function useraction_search_user_res($user_id, int $referrer = 0)
{
$field = 'id as user_id,agent_id,sex,user_nick,user_name,user_pic,user_status,user_phone,create_time,
referrer_source,referrer_id,registration_time';
referrer_source,referrer_id,registration_time,industry_type';
$data = db('u_users')
->where('id', $user_id)
->field($field)
......
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