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
fe4a24a0
Commit
fe4a24a0
authored
Aug 14, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关注的办公楼
parent
6d7ea626
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
2 deletions
+109
-2
AttentionShop.php
application/api/controller/AttentionShop.php
+33
-0
OfficeRoomApiService.php
application/api/service/OfficeRoomApiService.php
+49
-0
AttentionModel.php
application/model/AttentionModel.php
+24
-0
route.php
application/route.php
+3
-2
No files found.
application/api/controller/AttentionShop.php
View file @
fe4a24a0
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
app\api\controller
;
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\api\extend\Basic
;
use
app\api\service\OfficeRoomApiService
;
use
app\model\AttentionModel
;
use
app\model\AttentionModel
;
use
app\model\GHousesImgs
;
use
app\model\GHousesImgs
;
use
app\model\GImageDepot
;
use
app\model\GImageDepot
;
...
@@ -77,6 +78,8 @@ class AttentionShop extends Basic
...
@@ -77,6 +78,8 @@ class AttentionShop extends Basic
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$order_
=
'a.create_time desc'
;
$order_
=
'a.create_time desc'
;
//b.room_num_left 前端显示已下架,不可点击到详情
//b.room_num_left 前端显示已下架,不可点击到详情
$field
=
"a.id,a.house_id,b.external_title as title,b.shop_area_start as room_area,b.shop_area_end as room_area2,
$field
=
"a.id,a.house_id,b.external_title as title,b.shop_area_start as room_area,b.shop_area_end as room_area2,
...
@@ -87,6 +90,7 @@ class AttentionShop extends Basic
...
@@ -87,6 +90,7 @@ class AttentionShop extends Basic
return
$this
->
response
(
"101"
,
"用户id不能为空"
);
return
$this
->
response
(
"101"
,
"用户id不能为空"
);
}
}
$params
[
"is_del"
]
=
0
;
//关注中的商铺
$params
[
"is_del"
]
=
0
;
//关注中的商铺
$params
[
"type"
]
=
0
;
$result
=
$this
->
attentionModel
->
myAttentionList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$params
);
$result
=
$this
->
attentionModel
->
myAttentionList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$params
);
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
...
@@ -121,5 +125,33 @@ class AttentionShop extends Basic
...
@@ -121,5 +125,33 @@ class AttentionShop extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
/**
* 关注的办公楼
* @return \think\Response
*/
public
function
attentionOfficeList
()
{
$params
=
$this
->
params
;
/*
AuthToken:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjoiMTM1NjMwIiwidXNlck5pY2siOiIiLCJwaG9uZSI6IjE1NjIyMjMyMjExIn0sInRpbWVTdGFtcF8iOjE1NjU3NTAyMzV9.yiyHfGFHB8se7TJhJ2Enq4EcxrnzHFo7uxdTGgr0_HI
user_id:135630
pageSize:10
pageNo:1
*/
if
(
!
isset
(
$params
[
"user_id"
]))
{
return
$this
->
response
(
"101"
,
"用户id不能为空"
);
}
$s_office_room
=
new
OfficeRoomApiService
();
$result
=
$s_office_room
->
attentionOfficeList
(
$this
->
params
);
if
(
$result
[
'status'
]
==
'successful'
)
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
'data'
]);
}
else
{
return
$this
->
response
(
"101"
,
$result
[
'msg'
]);
}
}
}
}
\ No newline at end of file
application/api/service/OfficeRoomApiService.php
View file @
fe4a24a0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\api\service
;
namespace
app\api\service
;
use
app\model\AttentionModel
;
use
app\model\OfficeGBuildingStations
;
use
app\model\OfficeGBuildingStations
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGRoom
;
use
app\model\OfficeGRoom
;
...
@@ -203,5 +204,53 @@ class OfficeRoomApiService
...
@@ -203,5 +204,53 @@ class OfficeRoomApiService
}
}
return
$ids
;
return
$ids
;
}
}
/**
* 关注的办公楼
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
attentionOfficeList
(
$params
)
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$m_attention
=
new
AttentionModel
();
$field
=
"b.id,c.disc,c.title,c.address,d.name as business_name,b.building_id,b.price,b.price_total,c.status,b.is_rent"
;
$params
[
"a.type"
]
=
0
;
$order_
=
'a.create_time desc'
;
try
{
$result
=
$m_attention
->
myOfficeAttentionList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$params
);
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
return
$result
;
}
$result_data
=
[];
$gRoomImgModel
=
new
OfficeGImg
();
foreach
(
$result
as
$k
=>
$v
)
{
$tmp
[
'id'
]
=
$v
[
'id'
];
$tmp
[
'price'
]
=
empty
(
$v
[
'price'
])
?
0
:
$v
[
'price'
]
/
100
;
$tmp
[
'price_total'
]
=
empty
(
$v
[
'price_total'
])
?
0
:
$v
[
'price_total'
]
/
100
;
$tmp
[
'shop_sign'
]
=
$this
->
getBuildingSign
(
$v
[
'building_id'
]);
$tmp
[
'status'
]
=
$v
[
'status'
];
$tmp
[
'is_rent'
]
=
$v
[
'is_rent'
];
$area
=
$this
->
MinField
(
$v
[
'building_id'
],
'area'
);
$tmp
[
'title'
]
=
$v
[
'disc'
]
.
' '
.
$v
[
'business_name'
]
.
' '
.
$v
[
'title'
]
.
' '
.
$area
.
'㎡'
;
$tmp
[
'api_path'
]
=
CK_IMG_URL
.
'images/'
;
$house_img_where
[
"house_id"
]
=
$v
[
"id"
];
$house_img_where
[
"img_type"
]
=
2
;
$tmp
[
"images"
]
=
$gRoomImgModel
->
getCoverImage
(
'id,img_name'
,
$house_img_where
);
$result_data
[]
=
$tmp
;
}
$result
[
'status'
]
=
'successful'
;
$result
[
'data'
]
=
$result_data
;
return
$result
;
}
}
}
application/model/AttentionModel.php
View file @
fe4a24a0
...
@@ -111,6 +111,30 @@ class AttentionModel extends Model
...
@@ -111,6 +111,30 @@ class AttentionModel extends Model
->
select
();
->
select
();
}
}
/**
* 关注的办公楼
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $param
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
myOfficeAttentionList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
,
$param
)
{
$params
[
"a.is_del"
]
=
0
;
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'office_g_room b'
,
'a.house_id = b.id'
,
'left'
)
->
join
(
'office_g_building c'
,
'b.building_id = c.id'
,
'left'
)
->
join
(
'g_business_district d'
,
'c.business_district_id = d.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
/**
*根据userId和楼盘id获取是否关注此商铺
*根据userId和楼盘id获取是否关注此商铺
* @param $params
* @param $params
...
...
application/route.php
View file @
fe4a24a0
...
@@ -634,8 +634,9 @@ Route::group('api', [
...
@@ -634,8 +634,9 @@ Route::group('api', [
'getTradeList'
=>
[
'api/TradeLog/getTradeList'
,
[
'method'
=>
'post|get'
]],
'getTradeList'
=>
[
'api/TradeLog/getTradeList'
,
[
'method'
=>
'post|get'
]],
//AttentionShop
//AttentionShop
'addOrUpdateAttention'
=>
[
'api/AttentionShop/addOrUpdateAttention'
,
[
'method'
=>
'post|get'
]],
'addOrUpdateAttention'
=>
[
'api/AttentionShop/addOrUpdateAttention'
,
[
'method'
=>
'post|get'
]
],
'attentionList'
=>
[
'api/AttentionShop/attentionList'
,
[
'method'
=>
'post | get'
]],
'attentionList'
=>
[
'api/AttentionShop/attentionList'
,
[
'method'
=>
'post | get'
]
],
'attentionOfficeList'
=>
[
'api/AttentionShop/attentionOfficeList'
,
[
'method'
=>
'post | get'
]
],
//关注的办公楼
'addSublet'
=>
[
'api/Sublet/addSublet'
,
[
'method'
=>
'post|get'
]],
'addSublet'
=>
[
'api/Sublet/addSublet'
,
[
'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