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
3d1e3239
Commit
3d1e3239
authored
May 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺跟进
parent
b08a2361
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
4 deletions
+92
-4
HomePageLog.php
application/api_broker/controller/HomePageLog.php
+64
-4
GHousesFollowUp.php
application/model/GHousesFollowUp.php
+27
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/HomePageLog.php
View file @
3d1e3239
...
...
@@ -3,6 +3,7 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\GHousesFollowUp
;
use
app\model\UPhoneFollowPp
;
use
think\Request
;
...
...
@@ -17,11 +18,13 @@ class HomePageLog extends Basic
{
private
$uPhoneFollowUpModel
;
private
$gHouseFollowUpModel
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
uPhoneFollowUpModel
=
new
UPhoneFollowPp
();
$this
->
gHouseFollowUpModel
=
new
GHousesFollowUp
();
}
/**
...
...
@@ -35,10 +38,10 @@ class HomePageLog extends Basic
{
$params
=
$this
->
params
;
/* $params = array(
"start_time" => time(),
"end_time" => time() . " 23:59:59",
"name_or_phone" => "li",
"search_content" => "111",
"start_time" => time(),
//开始时间
"end_time" => time() . " 23:59:59",
//结束时间
"name_or_phone" => "li",
//用户姓名或电话
"search_content" => "111",
// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
...
...
@@ -78,5 +81,61 @@ class HomePageLog extends Basic
}
}
/**
* 首页商铺跟进
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
houseFollowUpList
()
{
$params
=
$this
->
params
;
/* $params = array(
"start_time" => time(), //开始时间
"end_time" => time() . " 23:59:59", //结束时间
"name_or_phone" => "li",//用户姓名或电话
"search_content" => "111",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
return
$this
->
response
(
"101"
,
'请选择时间'
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
"f.id,f.house_id,f.agent_id,f.follow_up_info,f.create_time,a.name,a.img,b.store_name"
;
if
(
!
empty
(
$params
[
"search_content"
]))
{
$where_
[
"f.follow_up_info"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'search_content'
])
.
"%"
);
}
if
(
!
empty
(
$params
[
"start_time"
])
&&
!
empty
(
$params
[
"end_time"
]))
{
$where_
[
"f.create_time"
]
=
array
(
'between'
,
array
(
$params
[
"start_time"
],
$params
[
"end_time"
]
)
);
}
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
$where_
[
"a.phone|a.name"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"name_or_phone"
])
.
"%"
);
}
$join
=
[
[
'a_agents a'
,
'a.id=f.agent_id'
,
'left'
],
[
'a_store b'
,
'b.id=a.store_id'
,
'left'
],
];
$order
=
"f.id desc"
;
$result
=
$this
->
gHouseFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
if
(
count
(
$result
)
>
0
)
{
$list
[
"result"
]
=
$result
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
}
\ No newline at end of file
application/model/GHousesFollowUp.php
View file @
3d1e3239
...
...
@@ -75,4 +75,30 @@ class GHousesFollowUp extends Model
->
where
(
$where_
)
->
select
();
}
/**
* 首页商铺跟进搜索
* @param int $p
* @param int $pageSize
* @param string $order_
* @param $field
* @param $join
* @param $where
* @param $group
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getSearch
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$join
,
$where
,
$group
)
{
$data
=
$this
->
db_
->
field
(
$field
)
->
alias
(
'f'
)
->
join
(
$join
)
->
where
(
$where
)
->
group
(
$group
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
echo
$this
->
getLastSql
();
return
$data
;
}
}
\ No newline at end of file
application/route.php
View file @
3d1e3239
...
...
@@ -444,6 +444,7 @@ Route::group('broker', [
//首页跟进记录
'userFollowUpList'
=>
[
'api_broker/HomePageLog/userFollowUpList'
,
[
'method'
=>
'get'
]
],
'houseFollowUpList'
=>
[
'api_broker/HomePageLog/houseFollowUpList'
,
[
'method'
=>
'get'
]
],
...
...
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