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
9960dd02
Commit
9960dd02
authored
Jun 10, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
无效房源
parent
a5f71958
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
223 additions
and
8 deletions
+223
-8
OfficeRoom.php
application/index/controller/OfficeRoom.php
+41
-5
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+133
-0
OfficeBuildingRoomValidate.php
application/index/validate/OfficeBuildingRoomValidate.php
+3
-1
OfficeGHouseFile.php
application/model/OfficeGHouseFile.php
+41
-0
route.php
application/route.php
+5
-2
No files found.
application/index/controller/OfficeRoom.php
View file @
9960dd02
...
...
@@ -235,13 +235,48 @@ class OfficeRoom extends Basic
*/
public
function
delHouseFile
()
{
$msg
=
''
;
$code
=
200
;
$result
=
$this
->
service
->
delHouseFile
(
$this
->
params
[
'id'
],
$this
->
params
[
'house_id'
],
$this
->
params
[
'save_path'
]);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
'删除失败'
;
$this
->
code
=
101
;
$this
->
msg
=
'删除失败'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
);
}
/**
* 伪删除商铺
*
* @return \think\Response
*/
public
function
del
()
{
$result
=
$this
->
service
->
delRoom
(
$this
->
params
);
if
(
$result
[
'status'
]
==
'successful'
)
{
$this
->
msg
=
$result
[
'msg'
];
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 获取独家方
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getExclusive
()
{
if
(
$this
->
params
[
'houses_id'
])
{
$this
->
data
=
$this
->
service
->
getExclusive
(
$this
->
params
[
'houses_id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'houses_id is null'
;
}
return
$this
->
response
(
$code
,
$msg
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/index/service/OfficeRoomService.php
View file @
9960dd02
...
...
@@ -17,6 +17,7 @@ use app\model\GBusinessDistrict;
use
app\model\OfficeACollectHouse
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuildingStations
;
use
app\model\OfficeGHouseFile
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGLandlordPhone
;
use
app\model\OfficeGOperatingRecord
;
...
...
@@ -36,6 +37,7 @@ class OfficeRoomService
private
$internet_path
;
private
$m_building_stations
;
private
$redis_service
;
private
$m_house_file
;
public
function
__construct
()
...
...
@@ -49,6 +51,7 @@ class OfficeRoomService
$this
->
landlord_phone
=
new
OfficeGLandlordPhone
();
$this
->
m_building_stations
=
new
OfficeGBuildingStations
();
$this
->
redis_service
=
new
RedisCacheService
();
$this
->
m_house_file
=
new
OfficeGHouseFile
();
if
(
CURRENT_URL
==
'https://api.tonglianjituan.com/'
)
{
$this
->
internet_path
=
IMAGES_URL
.
'/resource/lib/Attachments/images/'
;
...
...
@@ -88,6 +91,9 @@ class OfficeRoomService
$id
=
$this
->
m_office_room
->
addRoom
(
$data
,
$agent_id
);
if
(
$id
>
0
)
{
if
(
$scene
==
'exclusive'
)
{
$this
->
exclusiveFile
(
$data
,
$id
);
}
$remark
=
''
;
/*房东手机号处理 start*/
if
(
!
empty
(
$data
[
'landlord_phone'
]))
{
...
...
@@ -1289,4 +1295,130 @@ class OfficeRoomService
$shop_sign
=
implode
(
","
,
$ex_shop_sign_old
);
return
$shop_sign
;
}
/**
* 删除房源
*
* @param $data
* @return mixed
*/
public
function
delRoom
(
$data
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
$check
=
$this
->
validate
->
scene
(
'del'
)
->
check
(
$data
);
if
(
false
===
$check
)
{
$result
[
'msg'
]
=
$this
->
validate
->
getError
();
return
$result
;
}
$house_id
=
$this
->
m_office_room
->
getFieldOneValue
(
'id'
,
[
'id'
=>
$data
[
'id'
],
'status'
=>
[
'<>'
,
3
]]);
if
(
empty
(
$house_id
))
{
$result
[
'msg'
]
=
'没有该商铺'
;
return
$result
;
}
$is_ok
=
$this
->
m_office_room
->
editData
([
'status'
=>
3
],
$data
[
'id'
]);
if
(
$is_ok
)
{
//删除商铺对应的收藏商铺也要删除(改状态值)delCollectHouse
$collect_house
=
new
OfficeACollectHouse
();
$collect_house
->
delCollectHouse
(
$data
[
'id'
]);
$result
[
'status'
]
=
'successful'
;
$result
[
'msg'
]
=
'操作成功'
;
}
else
{
$result
[
'msg'
]
=
'操作失败'
;
}
return
$result
;
}
/**
* 获取独家方信息
*
* @param $room_id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getExclusive
(
$room_id
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
$data
=
$this
->
m_office_room
->
getFindData
(
'id,is_exclusive_type,agent_start_time,agent_end_time'
,
[
'id'
=>
$room_id
]);
if
(
empty
(
$data
[
'id'
]))
{
$result
[
'msg'
]
=
'没有该房源'
;
return
$result
;
}
$result
[
'id'
]
=
$data
[
'id'
];
$result
[
'is_exclusive_type'
]
=
$data
[
'is_exclusive_type'
];
$result
[
'agent_start_time'
]
=
$data
[
'agent_start_time'
];
$result
[
'agent_end_time'
]
=
$data
[
'agent_end_time'
];
$agent_data
=
$this
->
agent_room
->
getAgentsByRoomId
(
'b.id,b.name,b.phone'
,
[
'a.house_id'
=>
$room_id
,
'a.type'
=>
3
]);
if
(
$agent_data
)
{
$result
[
'name'
]
=
empty
(
$agents
[
'name'
])
?
''
:
$agents
[
'name'
]
.
'-'
.
$agents
[
'phone'
];
}
else
{
$result
[
'name'
]
=
''
;
}
$room_img
=
$this
->
m_office_img
->
getListAll
(
'img_name'
,[
'house_id'
=>
$room_id
,
'img_type'
=>
4
]);
if
(
$room_img
)
{
$result
[
'exclusive_img'
]
=
$room_img
;
}
else
{
$result
[
'exclusive_img'
]
=
[];
}
$house_file_where
[
'house_id'
]
=
$room_id
;
$house_file_where
[
'status'
]
=
0
;
$exclusive_file
=
$this
->
m_house_file
->
getHouseFileAll
(
'id,file_name'
,
$house_file_where
);
if
(
$exclusive_file
)
{
foreach
(
$exclusive_file
as
$k
=>
$v
)
{
$exclusive_file
[
$k
][
'file_name'
]
=
'/static/exclusive_file/'
.
$v
[
'file_name'
];
}
$result
[
'exclusive_file'
]
=
$exclusive_file
;
}
else
{
$result
[
'exclusive_file'
]
=
[];
}
return
$result
;
}
/**
* 独家附件操作
*
* @param $data
* @param $house_id
* @return array|int|string
*/
public
function
exclusiveFile
(
$data
,
$house_id
)
{
$result
=
[];
//新增附件
if
(
!
empty
(
$data
[
'exclusive_file'
]))
{
$exclusive_file_arr
=
explode
(
','
,
$data
[
'exclusive_file'
]);
$save_data
=
[];
foreach
(
$exclusive_file_arr
as
$k
=>
$v
)
{
$save_data
[
$k
][
'file_name'
]
=
$v
;
$save_data
[
$k
][
'house_id'
]
=
$house_id
;
$save_data
[
$k
][
'type'
]
=
0
;
$save_data
[
$k
][
'status'
]
=
0
;
}
$result
=
$this
->
m_house_file
->
insertAll
(
$save_data
);
}
//伪删除附件
if
(
!
empty
(
$data
[
'del_file_id'
]))
{
$file_id_arr
=
explode
(
','
,
$data
[
'del_file_id'
]);
foreach
(
$file_id_arr
as
$k
=>
$v
)
{
$result
[]
=
$this
->
m_house_file
->
where
(
'id'
,
$v
)
->
update
([
'status'
=>
1
]);
}
}
return
$result
;
}
}
\ No newline at end of file
application/index/validate/OfficeBuildingRoomValidate.php
View file @
9960dd02
...
...
@@ -114,6 +114,7 @@ class OfficeBuildingRoomValidate extends Validate
'age_limit_end'
,
'is_partition'
,
'carport'
,
'rent_free'
,
'source'
,
'decoration'
,
'shop_sign'
],
'detail'
=>
[
'id'
],
'is_carefully_chosen'
=>
[
'id'
,
'is_carefully_chosen'
],
'exclusive'
=>
[
'agent_start_time,agent_end_time,is_exclusive_type,id'
]
'exclusive'
=>
[
'agent_start_time,agent_end_time,is_exclusive_type,id'
],
'del'
=>
[
'id'
]
];
}
\ No newline at end of file
application/model/OfficeGHouseFile.php
0 → 100644
View file @
9960dd02
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/9/4
* Time: 13:29
*/
namespace
app\model
;
use
think\Db
;
class
OfficeGHouseFile
extends
BaseModel
{
protected
$table
=
'office_g_house_file'
;
private
$db_
;
public
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $field
* @param $where
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public
function
getHouseFileAll
(
$field
,
$where
)
{
try
{
$data
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
false
;
}
return
$data
;
}
}
\ No newline at end of file
application/route.php
View file @
9960dd02
...
...
@@ -1031,8 +1031,11 @@ Route::group('office_index', [
'adjustment'
=>
[
'index/OfficePayLog/adjustment'
,
[
'method'
=>
'get'
]],
//导出收款记录
'getCollectionDetail'
=>
[
'index/OfficePayLog/getCollectionDetail'
,
[
'method'
=>
'get'
]],
//收款详情
'getAdjustmentDetail'
=>
[
'index/OfficePayLog/getAdjustmentDetail'
,
[
'method'
=>
'get'
]],
//调整收款详情
'carefullyChosen'
=>
[
'index/OfficeRoom/carefullyChosen'
,
[
'method'
=>
'POST|get'
]],
//设置精选楼盘
'carefullyChosen'
=>
[
'index/OfficeRoom/carefullyChosen'
,
[
'method'
=>
'POST'
]],
//设置精选楼盘
'editExclusive'
=>
[
'index/OfficeRoom/editExclusive'
,
[
'method'
=>
'POST'
]],
//添加和编辑楼盘独家
'addExclusive'
=>
[
'index/OfficeRoom/editExclusive'
,
[
'method'
=>
'POST'
]],
//添加楼盘独家
'getExclusive'
=>
[
'index/OfficeRoom/getExclusive'
,
[
'method'
=>
'get'
]],
//获取楼盘独家
'del'
=>
[
'index/OfficeRoom/del'
,
[
'method'
=>
'POST'
]],
//设置无效房源
]);
Route
::
group
(
'office_api'
,
[
...
...
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