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
2fe62253
Commit
2fe62253
authored
Jun 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除楼盘
parent
8a4fbf95
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
130 additions
and
7 deletions
+130
-7
OfficeManage.php
application/index/controller/OfficeManage.php
+57
-0
OfficeRoom.php
application/index/controller/OfficeRoom.php
+1
-1
OfficeService.php
application/index/service/OfficeService.php
+66
-6
index.html
application/index/view/office/index.html
+3
-0
route.php
application/route.php
+3
-0
No files found.
application/index/controller/OfficeManage.php
View file @
2fe62253
...
...
@@ -98,4 +98,60 @@ class OfficeManage extends Basic
return
$this
->
response
(
$code
,
$msg
);
}
/**
* 楼盘列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBuildingList
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'office/index'
);
}
$msg
=
''
;
$data
=
[];
$code
=
200
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$building_service
=
new
OfficeService
();
$result
=
$building_service
->
BuildingSearch
(
$pageNo
,
$pageSize
,
$this
->
params1
,
1
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
else
{
$data
=
$result
[
'data'
];
}
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
/**
* 楼盘列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
delBuilding
()
{
$msg
=
''
;
$data
=
[];
$code
=
200
;
$building_service
=
new
OfficeService
();
$result
=
$building_service
->
delOfficeBuilding
(
$this
->
params
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
else
{
$data
=
$result
[
'data'
];
}
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
\ No newline at end of file
application/index/controller/OfficeRoom.php
View file @
2fe62253
...
...
@@ -9,7 +9,7 @@
namespace
app\index\controller
;
use
app\
api_broker
\extend\Basic
;
use
app\
index
\extend\Basic
;
use
app\index\service\OfficeRoomService
;
use
app\index\service\OfficeService
;
...
...
application/index/service/OfficeService.php
View file @
2fe62253
...
...
@@ -30,7 +30,7 @@ class OfficeService
}
/**
* 新增或编辑楼盘
* 新增或编辑楼盘
字典
*
* @param array $data
* @param int $agent_id 上传人id
...
...
@@ -103,7 +103,7 @@ class OfficeService
}
/**
* 楼盘详情
* 楼盘
字典
详情
*
* @param int $id
* @param int $app
...
...
@@ -167,7 +167,7 @@ class OfficeService
}
/**
* 删除图片
* 删除
楼盘字典
图片
*
* @param int $id
* @param $house_id
...
...
@@ -209,15 +209,18 @@ class OfficeService
}
/**
* 楼盘字典查询
*
* @param $page_size
* @param $page_no
* @param $params
* @param $is_total
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
BuildingSearch
(
$page_size
,
$page_no
,
$params
)
public
function
BuildingSearch
(
$page_size
,
$page_no
,
$params
,
$is_total
=
0
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
...
...
@@ -231,12 +234,68 @@ class OfficeService
return
$result
;
}
$field
=
'id,title,address'
;
$where
[
'title'
]
=
[
'LIKE'
,
'%'
.
$params
[
'title'
]
.
'%'
];
if
(
isset
(
$params
[
'title'
]))
{
$where
[
'title'
]
=
[
'LIKE'
,
'%'
.
$params
[
'title'
]
.
'%'
];
}
if
(
isset
(
$params
[
'disc'
]))
{
$where
[
'disc'
]
=
$params
[
'disc'
];
}
if
(
isset
(
$params
[
'`business_district_id`'
]))
{
$where
[
'business_district_id'
]
=
$params
[
'business_district_id'
];
}
if
(
isset
(
$params
[
'type'
]))
{
$where
[
'type'
]
=
$params
[
'type'
];
}
$field
=
'id,title,address,type'
;
$where
[
'city'
]
=
$params
[
'city'
];
$data
=
$this
->
m_office
->
getList
(
$page_size
,
$page_no
,
''
,
$field
,
$where
);
if
(
$is_total
)
{
$data
=
$this
->
m_office
->
getTotal
(
$where
);
}
$result
[
'data'
]
=
$data
;
$result
[
'status'
]
=
'successful'
;
return
$result
;
}
/**
* 删除楼盘字典
*
* @param $id
* @return false|int
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-2 上午11:16
*/
public
function
delOfficeBuilding
(
$id
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
if
(
empty
(
$id
))
{
$result
[
'msg'
]
=
'参数错误'
;
return
$result
;
}
$id
=
$this
->
m_office
->
getFindData
(
'id'
,
[
'id'
=>
$id
]);
if
(
empty
(
$id
[
'id'
]))
{
$data
[
'msg'
]
=
'没有该记录'
;
}
else
{
$result
=
$this
->
m_office
->
editData
([
'is_del'
=>
1
],
$id
[
'id'
]);
if
(
$result
)
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
'删除成功'
;
}
else
{
$data
[
'msg'
]
=
'删除失败'
;
}
}
return
$data
;
}
}
\ No newline at end of file
application/index/view/office/index.html
0 → 100644
View file @
2fe62253
{layout name="global/frame_two_tpl" /}
楼盘列表
\ No newline at end of file
application/route.php
View file @
2fe62253
...
...
@@ -979,6 +979,8 @@ Route::group('office_index', [
'delBuildingFile'
=>
[
'index/OfficeBuilding/delBuildingFile'
,
[
'method'
=>
'POST'
]],
//删除楼盘图片
'getBuildingSearch'
=>
[
'index/OfficeRoom/getBuildingSearch'
,
[
'method'
=>
'GET'
]],
//搜索楼盘
'getBuildingDetail'
=>
[
'index/OfficeRoom/getBuildingDetail'
,
[
'method'
=>
'GET'
]],
//楼盘详情
'getBuildingList'
=>
[
'index/OfficeManage/getBuildingList'
,
[
'method'
=>
'GET'
]],
//楼盘列表
'delBuilding'
=>
[
'index/OfficeManage/delBuilding'
,
[
'method'
=>
'GET'
]],
//删除楼盘
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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