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
604c6e6d
Commit
604c6e6d
authored
Jul 01, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
19f5f0f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
14 deletions
+36
-14
OfficeRoom.php
application/api/controller/OfficeRoom.php
+1
-1
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+35
-13
No files found.
application/api/controller/OfficeRoom.php
View file @
604c6e6d
...
...
@@ -44,7 +44,7 @@ class OfficeRoom extends Basic
}
$id
=
$params
[
'id'
];
$result
=
$this
->
service
->
getOfficeRoomInfo
(
$id
,
1
,
1
);
$result
=
$this
->
service
->
getOfficeRoomInfo
(
$id
,
$this
->
userId
,
1
);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
...
...
application/index/service/OfficeRoomService.php
View file @
604c6e6d
...
...
@@ -13,6 +13,7 @@ use app\api_broker\service\PushMessageService;
use
app\api_broker\service\RedisCacheService
;
use
app\index\validate\OfficeBuildingRoomValidate
;
use
app\model\AAgents
;
use
app\model\AttentionModel
;
use
app\model\GBusinessDistrict
;
use
app\model\OfficeACollectHouse
;
use
app\model\OfficeGBuilding
;
...
...
@@ -703,7 +704,7 @@ class OfficeRoomService
//楼盘图
$result
[
'building_image'
]
=
$this
->
getBuildingImage
(
$result
[
'building_id'
]);
//是否被收藏
$result
[
'is_collect'
]
=
$this
->
isCollect
(
$result
[
'id'
],
$agent_id
);
$result
[
'is_collect'
]
=
$this
->
isCollect
(
$result
[
'id'
],
$agent_id
,
$type
);
//是否可编辑
$result
[
'is_can_edit'
]
=
$this
->
isCanEdit
(
$result
[
'id'
],
$agent_id
);
//微信分享图 原来的随机图
...
...
@@ -731,21 +732,42 @@ class OfficeRoomService
//是否被收藏
private
function
isCollect
(
$house_id
,
$agent_id
)
private
function
isCollect
(
$house_id
,
$agent_id
,
$type
)
{
$m_collect_room
=
new
OfficeACollectHouse
();
//是否被收藏
$is_collect
=
2
;
if
(
$agent_id
)
{
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$agent_id
;
$get_params
[
'house_id'
]
=
$house_id
;
$res
=
$m_collect_room
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$is_collect
=
1
;
if
(
$type
==
1
){
$is_collect
=
$this
->
isCollectToC
(
$house_id
,
$agent_id
);
}
else
{
$m_collect_room
=
new
OfficeACollectHouse
();
//是否被收藏
$is_collect
=
2
;
if
(
$agent_id
)
{
//先判断是否已经存在数据
$field
=
'id,status'
;
$get_params
[
'agents_id'
]
=
$agent_id
;
$get_params
[
'house_id'
]
=
$house_id
;
$res
=
$m_collect_room
->
getCollectHouse
(
$field
,
$get_params
);
if
(
$res
&&
(
$res
[
0
][
'status'
]
==
1
))
{
//如果存在
$is_collect
=
1
;
}
}
}
return
$is_collect
;
}
//C是否被收藏
private
function
isCollectToC
(
$house_id
,
$user_id
){
$m_attention
=
new
AttentionModel
();
$attention
[
"user_id"
]
=
array
(
"eq"
,
$user_id
);
$attention
[
"house_id"
]
=
array
(
"eq"
,
$house_id
);
$attention
[
"is_del"
]
=
array
(
"eq"
,
0
);
$attention
[
"type"
]
=
array
(
"eq"
,
1
);
$attResult
=
$m_attention
->
getAttentionByUserIdAndHouseId
(
$attention
);
$is_collect
=
0
;
if
(
count
(
$attResult
)
>
0
)
$is_collect
=
$attResult
[
0
][
'id'
];
return
$is_collect
;
}
...
...
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