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
8deed5de
Commit
8deed5de
authored
Apr 21, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fb150631
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
1 deletion
+94
-1
FindShop.php
application/api/controller/FindShop.php
+1
-1
FindShop.php
application/index/controller/FindShop.php
+78
-0
UFindShop.php
application/model/UFindShop.php
+13
-0
route.php
application/route.php
+2
-0
No files found.
application/api/controller/FindShop.php
View file @
8deed5de
...
...
@@ -24,7 +24,7 @@ class FindShop extends Basic
parent
::
__construct
(
$request
);
}
/**
* 新增取消修改找铺需求
* @return \think\Response
...
...
application/index/controller/FindShop.php
0 → 100644
View file @
8deed5de
<?php
namespace
app\index\controller
;
use
app\index\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
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$conditions
=
[];
if
(
$params
[
'is_my'
]
!=
0
&&
$params
[
'is_my'
]
!=
1
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
(
$params
[
'is_my'
]
==
0
&&
empty
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"我的客户经纪人id不能为空"
);
}
elseif
(
$params
[
'is_my'
]
==
0
&&
!
empty
(
$params
[
'agent_id'
])){
$conditions
[
"b.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'
];
$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
[
'b.agent_id'
]
=
array
(
'gt'
,
0
);
}
elseif
(
isset
(
$params
[
'is_inviter'
])
&&
$params
[
'is_inviter'
]
==
2
)
{
$conditions
[
'b.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_type,a.price_start,a.price_end,a.update_time,a.create_time"
;
$result
=
$findShopModel
->
getFindShopAndUserList
(
$field
,
$conditions
,
1
,
1
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
}
\ No newline at end of file
application/model/UFindShop.php
View file @
8deed5de
...
...
@@ -48,6 +48,19 @@ class UFindShop extends Model{
->
select
();
}
public
function
getFindShopAndUserList
(
$field
,
$params
,
$page_no
,
$page_size
)
{
$params
[
"a.status"
]
=
0
;
return
$this
->
db_
->
alias
(
"a"
)
->
join
(
"u_users b"
,
"a.user_id = b.id"
,
"left"
)
->
field
(
$field
)
->
where
(
$params
)
->
page
(
$page_no
)
->
limit
(
$page_size
)
->
select
();
}
/**
* @param $params
* @return int
...
...
application/route.php
View file @
8deed5de
...
...
@@ -454,6 +454,8 @@ Route::group('index', [
'bargainListSearchBargainId'
=>
[
'index/Bargain/bargainListSearchBargainId'
,
[
'method'
=>
'POST|GET'
]
],
'getFindShopList'
=>
[
'index/FindShop/getFindShopList'
,
[
'method'
=>
'POST|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