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
594f793e
Commit
594f793e
authored
Apr 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
a6c2240b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
AttentionShop.php
application/api/controller/AttentionShop.php
+13
-11
AttentionModel.php
application/model/AttentionModel.php
+3
-3
No files found.
application/api/controller/AttentionShop.php
View file @
594f793e
...
...
@@ -4,6 +4,7 @@ namespace app\api\controller;
use
app\api\extend\Basic
;
use
app\model\AttentionModel
;
use
app\model\GHousesImgs
;
use
think\Request
;
use
app\model\HouseImgs
;
...
...
@@ -19,12 +20,14 @@ class AttentionShop extends Basic
protected
$attentionModel
;
protected
$dbImg
;
protected
$imgModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
attentionModel
=
new
AttentionModel
();
$this
->
dbImg
=
new
HouseImgs
();
$this
->
imgModel
=
new
GHousesImgs
();
}
/**
...
...
@@ -61,20 +64,20 @@ class AttentionShop extends Basic
*/
public
function
attentionList
()
{
$params
=
$this
->
params
;
/* $params
= array(
"user_id" => 47
,
"pageNo"
=> 1,
"pageSize" => 15,
);*/
$params
=
$this
->
params
;
$params
=
array
(
"user_id"
=>
122
,
"pageNo"
=>
1
,
"pageSize"
=>
15
,
);
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$order_
=
'a.create_time desc'
;
//b.room_num_left 前端显示已下架,不可点击到详情
$field
=
"a.id,a.house_id,b.
title,b.room_area,b.room_area2,b.price,b.shangpu_tags,b.shangpu_type,b.room_num_left
,b.rent_type,c.foreign_nam
e"
;
$field
=
"a.id,a.house_id,b.
external_title,b.shop_area_start as room_area,b.shop_area_end as room_area2,b.rent_price as price,
b.shop_sign as shangpu_tags,b.shop_type as shangpu_type,b.residue_num as room_num_left,b.rent_typ
e"
;
if
(
!
isset
(
$params
[
"user_id"
]))
{
return
$this
->
response
(
"101"
,
"用户id不能为空"
);
...
...
@@ -88,12 +91,11 @@ class AttentionShop extends Basic
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$imgParam
[
"house_id"
]
=
$val
[
"house_id"
];
$imgParam
[
"img
type"
]
=
1
;
//默认主图
$imgArr
=
$this
->
dbImg
->
getHouseImages
(
$imgParam
,
1
);
$imgParam
[
"img
_type"
]
=
1
;
//默认主图
$imgArr
=
$this
->
imgModel
->
getHouseImages
(
$imgParam
,
1
);
$result
[
$key
][
"images"
]
=
$imgArr
;
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
...
...
application/model/AttentionModel.php
View file @
594f793e
...
...
@@ -92,11 +92,11 @@ class AttentionModel extends Model
$params
[
"a.user_id"
]
=
$param
[
"user_id"
];
$params
[
"a.is_del"
]
=
$param
[
"is_del"
];
//$params["b.room_num_left"] = array( "<>", 0 ); //剩余数为0 的商品不显示
$params
[
"b.
show_all
"
]
=
array
(
"eq"
,
0
);
//只显示公开的楼盘
$params
[
"b.
is_show
"
]
=
array
(
"eq"
,
0
);
//只显示公开的楼盘
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'
houseinfo
s b'
,
'a.house_id = b.id'
,
'LEFT'
)
->
join
(
'
houseinfo_ext
s c'
,
'c.house_id = b.id'
,
'LEFT'
)
->
join
(
'
g_house
s b'
,
'a.house_id = b.id'
,
'LEFT'
)
->
join
(
'
g_houses_img
s c'
,
'c.house_id = b.id'
,
'LEFT'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
...
...
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