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
3b6e7cc2
Commit
3b6e7cc2
authored
Jul 17, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
找铺
parent
31073543
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
1 deletion
+82
-1
FindShop.php
application/api_broker/controller/FindShop.php
+81
-0
route.php
application/route.php
+1
-1
No files found.
application/api_broker/controller/FindShop.php
0 → 100644
View file @
3b6e7cc2
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\UFindShop
;
use
think\Request
;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/4/21
* Time: 10:49
*/
class
FindShop
extends
Basic
{
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
}
/**
* @return \think\Response
*/
public
function
getFindShopList
()
{
$params
=
$this
->
params
;
$params
=
array
(
"is_my"
=>
0
,
//0我的客户 1全部客户
"agent_id"
=>
1
,
// "submit_time_start" => "2019-03-01",
// "submit_time_end" => "2019-04-21",
// "user_id" => 1,
// "user_phone" => "1381764632",
// "is_inviter" => 0, //0全部 1有客方 2无客方
"page_no"
=>
1
,
"page_size"
=>
15
,
);
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$conditions
=
[];
if
(
$params
[
'is_my'
]
!=
0
&&
$params
[
'is_my'
]
!=
1
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$conditions
[
'c.site_id'
]
=
$conditions
[
'a.site_id'
]
=
$this
->
siteId
;
if
(
$params
[
'is_my'
]
==
0
&&
empty
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"我的客户经纪人id不能为空"
);
}
elseif
(
$params
[
'is_my'
]
==
0
&&
!
empty
(
$params
[
'agent_id'
])){
$conditions
[
"c.agent_id"
]
=
$params
[
'agent_id'
];
}
if
(
isset
(
$params
[
'submit_time_start'
])
&&
isset
(
$params
[
'submit_time_end'
]))
{
$submit_time_start
=
$params
[
'submit_time_start'
];
$submit_time_end
=
$params
[
'submit_time_end'
]
.
" 23:59:59"
;
$conditions
[
'a.create_time'
]
=
array
(
'between'
,
array
(
$submit_time_start
,
$submit_time_end
));
}
if
(
isset
(
$params
[
'user_id'
]))
{
$conditions
[
'a.user_id'
]
=
$params
[
'user_id'
];
}
if
(
isset
(
$params
[
'user_phone'
]))
{
$conditions
[
'b.user_phone'
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
}
if
(
isset
(
$params
[
'is_inviter'
])
&&
$params
[
'is_inviter'
]
==
1
)
{
$conditions
[
'c.agent_id'
]
=
array
(
'gt'
,
0
);
}
elseif
(
isset
(
$params
[
'is_inviter'
])
&&
$params
[
'is_inviter'
]
==
2
)
{
$conditions
[
'c.agent_id'
]
=
0
;
}
$findShopModel
=
new
UFindShop
();
$field
=
"a.id,a.user_id,a.user_name,a.site_id,a.city,a.disc,a.business_district_id,a.business_district_name,
a.industry_type,a.area_start,a.area_end,a.price_start,a.price_end,a.create_time,b.user_phone"
;
$list
=
$findShopModel
->
getFindShopAndUserList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
);
foreach
(
$list
as
$key
=>
$item
){
$list
[
$key
][
"user_phone"
]
=
substr_replace
(
$item
[
"user_phone"
],
'****'
,
3
,
4
);
}
$result
[
"list"
]
=
$list
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
}
\ No newline at end of file
application/route.php
View file @
3b6e7cc2
...
...
@@ -960,7 +960,7 @@ Route::group('broker', [
'moveHouseAgent'
=>
[
'api_broker/User/moveHouseAgent'
,
[
'method'
=>
'GET|POST'
]],
//客方同步到新表
'moveHouseSiteId'
=>
[
'api_broker/User/moveHouseSiteId'
,
[
'method'
=>
'GET|POST'
]],
//站点同步到新表
'getFindShopListIsMy'
=>
[
'api_broker/FindShop/getFindShopList'
,
[
'method'
=>
'GET'
]],
//委托找铺
]);
Route
::
group
(
'search'
,
[
...
...
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