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
88945735
Commit
88945735
authored
Dec 06, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询商铺列表
parent
9aceacd3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
11 deletions
+74
-11
Shop.php
application/api/controller/Shop.php
+49
-6
database.php
application/database.php
+5
-5
HouseInfos.php
application/model/HouseInfos.php
+20
-0
No files found.
application/api/controller/Shop.php
View file @
88945735
...
...
@@ -8,19 +8,61 @@ namespace app\api\controller;
* Intro: 获取商铺list
*/
use
app\common\Basic
;
use
app\model\HouseInfos
;
class
Shop
extends
Basic
{
/** 获取商铺列表
* @param $params
*/
public
function
getShopList
(
$params
){
$params
[
'carefully_chosen'
];
//是否精选 0是1否
$params
[
'shangpu_type'
];
//0商场,1街铺
$params
[
'disc'
];
//区域 如 黄埔区
public
function
getShopList
()
{
/* $params['carefully_chosen']; //是否精选 0是1否
$params['shangpu_type']; //商铺类型 0商场,1街铺
$params['yetai']; //业态
$params
[
'area_start'
];
//面积起始范围
$params['area_start'];//面积起始范围 room_area2
$params['area_end'];//面积结束范围
$params['sales'];//0上2下架
$params['money_start'];//price2 租金
$params['money_end'];//price2 租金 范围
$params['shangpu_tags'];//商铺标签
//-------
$params['show_all'];//是否公开0是1否
$params['title'];//商铺名 模糊查询
$params['city'];//市
$params['disc']; //区域 如 黄埔区
$params['site_area'];//来源1app首页 2搜索*/
$params
=
array
(
"site_area"
=>
1
,
"carefully_chosen"
=>
1
);
$conditions
=
array
();
if
(
empty
(
$params
[
'site_area'
]))
{
return
$this
->
response
(
"101"
,
"请求来源不能为空"
);
}
switch
(
$params
[
'site_area'
])
{
case
1
:
if
(
!
empty
(
$params
[
'carefully_chosen'
])
&&
$params
[
'carefully_chosen'
]
==
0
)
{
$conditions
[
'carefully_chosen'
]
=
$params
[
'carefully_chosen'
];
}
break
;
case
2
:
break
;
default
:
return
$this
->
response
(
"101"
,
"请求数据异常"
);
}
if
(
!
empty
(
$conditions
))
{
$conditions
[
'sales'
]
=
0
;
//排除下架的店铺
}
$HouseInfos
=
new
HouseInfos
();
$result
=
$HouseInfos
->
getHouseInfoList
(
1
,
15
,
$conditions
);
if
(
empty
(
$result
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
$this
->
response
(
);
return
$this
->
response
(
"200"
,
''
,
$result
);
}
}
\ No newline at end of file
application/database.php
View file @
88945735
...
...
@@ -13,15 +13,15 @@ return [
// 数据库类型
'type'
=>
'mysql'
,
// 服务器地址
'hostname'
=>
'1
27.0.0.1
'
,
'hostname'
=>
'1
01.132.186.250
'
,
// 数据库名
'database'
=>
''
,
'database'
=>
'
db_tongliandichan
'
,
// 用户名
'username'
=>
'
root
'
,
'username'
=>
'
tldc_online
'
,
// 密码
'password'
=>
''
,
'password'
=>
'
Fujuhaofang123
'
,
// 端口
'hostport'
=>
''
,
'hostport'
=>
'
3308
'
,
// 连接dsn
'dsn'
=>
''
,
// 数据库连接参数
...
...
application/model/HouseInfos.php
View file @
88945735
...
...
@@ -2,9 +2,29 @@
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
HouseInfos
extends
Model
{
protected
$table
=
'houseinfos'
;
protected
$dbHouseInfo
;
function
__construct
()
{
$this
->
dbHouseInfo
=
Db
::
table
(
$this
->
table
);
}
function
getHouseInfoList
(
$pageNo
=
1
,
$pageSize
=
15
,
$params
)
{
/* $where_ = "";
if (!empty($params['carefully_chosen'])) {
$where_ .= "carefully_chosen = :carefully_chosen";
}*/
return
$this
->
dbHouseInfo
->
where
(
"carefully_chosen =: id"
)
->
bind
([
"id"
=>
'0'
])
->
select
();
}
}
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