Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
d526563f
Commit
d526563f
authored
Aug 08, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
45807a9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
40 deletions
+33
-40
User.php
application/api_broker/controller/User.php
+32
-37
Users.php
application/model/Users.php
+1
-3
No files found.
application/api_broker/controller/User.php
View file @
d526563f
...
...
@@ -61,99 +61,94 @@ class User extends Basic
public
function
searchUser
()
{
$params
=
$this
->
params
;
/*
$params = array(
$params
=
array
(
"user_status"
=>
0
,
//客户状态(0:求租;1:已租;-1:无效)
"yetai" => "休闲娱乐",
"area_start" => 1,//面积起始范围 room_area2
"area_end" => 65,//面积结束范围
"money_start" => 1,//租金 price2
"money_end" => 10000,//租金
"start_time" => "2016-05-25",
"end_time" => "2018-05-30",
"user_id" => 1,
"user_name" => "12312",
"user_phone" => "138171212",
"follow_content" => "1",
/* "yetai" => "休闲娱乐",
"area_start" => 1,//面积起始范围 room_area2
"area_end" => 65,//面积结束范围
"money_start" => 1,//租金 price2
"money_end" => 10000,//租金
"start_time" => "2016-05-25",
"end_time" => "2018-05-30",
"user_id" => 1,
"user_name" => "12312",
"user_phone" => "138171212",*/
"pageNo"
=>
1
,
"agent_id" => 5741,//传经纪人id代表我得客户
//
"agent_id" => 5741,//传经纪人id代表我得客户
"pageSize"
=>
15
,
"status"
=>
-
1
,
);
*/
$field
=
"
a.id as user_id,a.sex,a.user_name,a.user_phone,a.user_status,a.agent_id,a.create_time,a.industry_type,a.price_demand,a.area_demand,a.
vip"
;
);
$field
=
"
id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,
vip"
;
$conditions
=
[];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$conditions
[
"
a.
city"
]
=
trim
(
$this
->
city
);
$conditions
[
"city"
]
=
trim
(
$this
->
city
);
if
(
isset
(
$params
[
'user_status'
]))
{
$conditions
[
'
a.
user_status'
]
=
$params
[
'user_status'
];
$conditions
[
'user_status'
]
=
$params
[
'user_status'
];
}
else
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
(
isset
(
$params
[
'user_id'
]))
{
$conditions
[
'
a.
id'
]
=
$params
[
'user_id'
];
$conditions
[
'id'
]
=
$params
[
'user_id'
];
}
if
(
isset
(
$params
[
'user_name'
]))
{
$conditions
[
'
a.
user_name'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_name'
])
.
"%"
);
$conditions
[
'user_name'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_name'
])
.
"%"
);
}
if
(
isset
(
$params
[
'user_phone'
]))
{
$conditions
[
'a.user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
}
if
(
isset
(
$params
[
'follow_content'
]))
{
$conditions
[
'b.content'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'follow_content'
])
.
"%"
);
$conditions
[
'user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
}
if
(
isset
(
$params
[
'yetai'
]))
{
$conditions
[
'
a.
industry_type'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'yetai'
])
.
"%"
);
$conditions
[
'industry_type'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'yetai'
])
.
"%"
);
}
$area_start
=
isset
(
$params
[
'area_start'
])
?
$params
[
'area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'area_end'
])
?
$params
[
'area_end'
]
:
-
1
;
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
$conditions
[
'a
.a
rea_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'a
.a
rea_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'area_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
$conditions
[
'area_demand'
]
=
array
(
'between'
,
array
(
$area_start
,
$area_end
)
);
}
else
if
(
$area_start
>=
0
&&
$area_end
<
0
)
{
//100米以上不用传结束面积
$conditions
[
'a
.a
rea_demand'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'a
.a
rea_demand'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'area_demand'
]
=
array
(
'egt'
,
$area_start
);
$conditions
[
'area_demand'
]
=
array
(
'egt'
,
$area_start
);
}
$price_start
=
isset
(
$params
[
'money_start'
])
?
$params
[
'money_start'
]
:
-
1
;
$price_end
=
isset
(
$params
[
'money_end'
])
?
$params
[
'money_end'
]
:
-
1
;
if
(
$price_start
>=
0
&&
$price_end
>=
0
)
{
//金额
$conditions
[
'
a.
price_demand'
]
=
array
(
'between'
,
array
(
$price_start
,
$price_end
)
);
$conditions
[
'price_demand'
]
=
array
(
'between'
,
array
(
$price_start
,
$price_end
)
);
}
else
if
(
$price_start
>=
0
&&
$price_end
<
0
)
{
$conditions
[
'
a.
price_demand'
]
=
array
(
'egt'
,
$price_start
);
$conditions
[
'price_demand'
]
=
array
(
'egt'
,
$price_start
);
}
if
(
isset
(
$params
[
'start_time'
])
&&
isset
(
$params
[
'end_time'
]))
{
$start_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'start_time'
]);
$end_time
=
date
(
'Y-m-d H:i:s'
,
$params
[
'end_time'
]);
$conditions
[
'
a.
create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
else
{
$time_
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"-1 day"
));
$conditions
[
'
a.
create_time'
]
=
array
(
'lt'
,
$time_
);
$conditions
[
'create_time'
]
=
array
(
'lt'
,
$time_
);
}
if
(
isset
(
$params
[
'status'
]))
{
$conditions
[
'
a.
status'
]
=
$params
[
'status'
];
$conditions
[
'status'
]
=
$params
[
'status'
];
}
//传了经纪人id则表示我的客户
if
(
isset
(
$params
[
"agent_id"
]))
{
$conditions
[
'a
.a
gent_id'
]
=
$params
[
'agent_id'
];
$conditions
[
'agent_id'
]
=
$params
[
'agent_id'
];
}
$userList
=
$this
->
userModel
->
selectUserList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
,
"
a.
id desc"
);
$userList
=
$this
->
userModel
->
selectUserList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
,
"id desc"
);
if
(
empty
(
$userList
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
...
...
@@ -171,7 +166,7 @@ class User extends Basic
}
$vip_services
=
new
VipService
();
$data
[
'examine_vip'
]
=
$vip_services
->
vip
(
$this
->
agentId
);
//
$data['examine_vip'] = $vip_services->vip($this->agentId);
$data
[
'user_date'
]
=
$list
;
return
$this
->
response
(
"200"
,
'request success'
,
$data
);
}
...
...
application/model/Users.php
View file @
d526563f
...
...
@@ -556,12 +556,10 @@ class Users extends Model
->
select
();
}
public
function
selectUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
=
"
a.
id desc"
)
public
function
selectUserList
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$order
=
" id desc"
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_phone_follow_up b"
,
"a.id = b.user_id"
,
"left"
)
->
where
(
$params
)
->
order
(
$order
)
->
page
(
$pageNo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment