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
3d0495b5
Commit
3d0495b5
authored
Aug 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
433b1270
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
63 deletions
+59
-63
HomePageLog.php
application/api_broker/controller/HomePageLog.php
+59
-63
No files found.
application/api_broker/controller/HomePageLog.php
View file @
3d0495b5
...
@@ -39,14 +39,14 @@ class HomePageLog extends Basic
...
@@ -39,14 +39,14 @@ class HomePageLog extends Basic
public
function
userFollowUpList
()
public
function
userFollowUpList
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*$params = array(
/*$params = array(
"start_time" => strtotime('2016-08-14 15:47:36'), //开始时间
"start_time" => strtotime('2016-08-14 15:47:36'), //开始时间
"end_time" => strtotime('2018-08-14 15:47:36'), //结束时间
"end_time" => strtotime('2018-08-14 15:47:36'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话 经纪人
"name_or_phone" => "18112347151",//用户姓名或电话 经纪人
"search_content" => "",// 搜索跟进内容
"search_content" => "",// 搜索跟进内容
"pageNo" => 1,
"pageNo" => 1,
"pageSize" => 15
"pageSize" => 15
);*/
);*/
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
return
$this
->
response
(
"101"
,
'请选择时间'
);
return
$this
->
response
(
"101"
,
'请选择时间'
);
...
@@ -65,49 +65,45 @@ class HomePageLog extends Basic
...
@@ -65,49 +65,45 @@ class HomePageLog extends Basic
$end_time
=
date
(
"Y-m-d H:i:s"
,
$params
[
"end_time"
]);
$end_time
=
date
(
"Y-m-d H:i:s"
,
$params
[
"end_time"
]);
$where_
[
"f.create_time"
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
$where_
[
"f.create_time"
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
}
/*if (!empty($params["name_or_phone"])) {
$where_["a.name|a.phone"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
}*/
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
}
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_field
=
"id"
;
$agent_field
=
"id"
;
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
if
(
$res_a
)
{
if
(
$res_a
)
{
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
}
}
}
}
$where_
[
"f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
$where_
[
"f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
$join
=
[];
$join
=
[];
$order
=
"f.id desc"
;
$order
=
"f.id desc"
;
$result
=
$this
->
uPhoneFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
$result
=
$this
->
uPhoneFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
foreach
(
$result
as
$key
=>
$value
)
{
foreach
(
$result
as
$key
=>
$value
)
{
$agent_params
=
[];
$agent_params
=
[];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_field
=
"a.name,a.img,b.store_name"
;
$agent_field
=
"a.name,a.img,b.store_name"
;
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
}
}
$count
=
$this
->
uPhoneFollowUpModel
->
getSearchCount
(
$join
,
$where_
);
$count
=
$this
->
uPhoneFollowUpModel
->
getSearchCount
(
$join
,
$where_
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$list
[
"result"
]
=
$result
;
$list
[
"result"
]
=
$result
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
//暂时处理
//暂时处理
$list
[
"total"
]
=
$count
;
$list
[
"total"
]
=
$count
;
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
}
else
{
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
return
$this
->
response
(
"200"
,
"request null"
);
...
@@ -127,14 +123,14 @@ class HomePageLog extends Basic
...
@@ -127,14 +123,14 @@ class HomePageLog extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*$params = array(
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageNo" => 1,
"pageSize" => 15
"pageSize" => 15
);*/
);*/
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
return
$this
->
response
(
"101"
,
'请选择时间'
);
return
$this
->
response
(
"101"
,
'请选择时间'
);
...
@@ -158,9 +154,9 @@ class HomePageLog extends Basic
...
@@ -158,9 +154,9 @@ class HomePageLog extends Basic
}
}
if
(
empty
(
$params
[
'city'
]))
{
if
(
empty
(
$params
[
'city'
]))
{
$where_
[
"f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
$where_
[
"f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
}
else
{
}
else
{
$where_
[
"f.city"
]
=
$params
[
'city'
]
?
$params
[
'city'
]
:
'上海市'
;
$where_
[
"f.city"
]
=
$params
[
'city'
]
?
$params
[
'city'
]
:
'上海市'
;
}
}
if
(
!
empty
(
$params
[
'disc'
]))
{
if
(
!
empty
(
$params
[
'disc'
]))
{
...
@@ -168,16 +164,16 @@ class HomePageLog extends Basic
...
@@ -168,16 +164,16 @@ class HomePageLog extends Basic
}
}
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
}
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_field
=
"id"
;
$agent_field
=
"id"
;
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
if
(
$res_a
)
{
if
(
$res_a
)
{
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
}
}
}
}
...
@@ -185,24 +181,24 @@ class HomePageLog extends Basic
...
@@ -185,24 +181,24 @@ class HomePageLog extends Basic
$order
=
"f.id desc"
;
$order
=
"f.id desc"
;
$result
=
$this
->
gHouseFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
$result
=
$this
->
gHouseFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
foreach
(
$result
as
$key
=>
$value
)
{
foreach
(
$result
as
$key
=>
$value
)
{
$agent_params
=
[];
$agent_params
=
[];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_field
=
"a.name,a.img,b.store_name"
;
$agent_field
=
"a.name,a.img,b.store_name"
;
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
$house_params
=
[];
$house_params
=
[];
$house_params
[
"id"
]
=
$value
[
'house_id'
];
$house_params
[
"id"
]
=
$value
[
'house_id'
];
$house_field
=
"internal_title"
;
$house_field
=
"internal_title"
;
$model
=
new
GHouses
();
$model
=
new
GHouses
();
$res_a
=
$model
->
getHouseInfo
(
$house_field
,
$house_params
);
$res_a
=
$model
->
getHouseInfo
(
$house_field
,
$house_params
);
$result
[
$key
][
'internal_title'
]
=
$res_a
[
0
][
'internal_title'
];
$result
[
$key
][
'internal_title'
]
=
$res_a
[
0
][
'internal_title'
];
}
}
$count
=
$this
->
gHouseFollowUpModel
->
getSearchCount
(
$join
,
$where_
);
$count
=
$this
->
gHouseFollowUpModel
->
getSearchCount
(
$join
,
$where_
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$list
[
"result"
]
=
$result
;
$list
[
"result"
]
=
$result
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
...
...
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