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
43647f66
Commit
43647f66
authored
Jun 11, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片删除
parent
a38c9e11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
Houses.php
application/index/controller/Houses.php
+39
-1
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Houses.php
View file @
43647f66
...
...
@@ -13,6 +13,7 @@ use app\api\controller\Sublet;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\SubletModel
;
use
think\Request
;
...
...
@@ -58,7 +59,7 @@ class Houses extends Basic
if
(
$this
->
request
->
isAjax
())
{
//获取商铺详情
$house
=
new
GHouses
();
$result
[
'data'
]
=
$house
->
getHouseById
(
$this
->
params
[
'id'
]);
$result
[
'data'
]
=
$house
->
getHouseById
(
$this
->
params
[
'id'
]
,
1
);
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//商铺添加页面
...
...
@@ -351,4 +352,40 @@ class Houses extends Basic
$agent
->
commit
();
return
$this
->
response
(
200
,
''
,
[
'total'
=>
count
(
$total
)]);
}
/**
* 删除图片
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
delHouseFile
()
{
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
''
;
if
(
empty
(
$this
->
params
[
'save_path'
])
||
empty
(
$this
->
params
[
'house_id'
]))
{
return
$this
->
response
(
$data
[
'status'
],
'Save_path or id house_id is null'
,
$data
[
'data'
]);
}
$img
=
new
GHousesImgs
();
$id
=
$img
->
getHouseImagesInfo
(
'id'
,
[
'house_id'
=>
$this
->
params
[
'house_id'
],
'img_name'
=>
$this
->
params
[
'save_path'
],
'img_status'
=>
0
]);
if
(
empty
(
$id
[
'id'
]))
{
$data
[
'msg'
]
=
'没有该文件'
;
}
else
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'resource'
.
DS
.
'lib'
.
DS
.
'Attachments'
.
DS
.
'Images/'
;
$img
->
editData
([
'img_status'
=>
1
],
$id
[
'id'
],
'id'
);
$data
[
'status'
]
=
200
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
\ No newline at end of file
application/route.php
View file @
43647f66
...
...
@@ -162,6 +162,7 @@ Route::group('index', [
'editExclusive'
=>
[
'index/houses/editExclusive'
,
[
'method'
=>
'post'
]
],
//添加和编辑楼盘独家
'getExclusive'
=>
[
'index/houses/getExclusive'
,
[
'method'
=>
'get'
]
],
//获取楼盘独家
'getRecords'
=>
[
'index/houses/getRecords'
,
[
'method'
=>
'get'
]
],
//操作记录
'delHouseFile'
=>
[
'index/houses/delHouseFile'
,
[
'method'
=>
'post'
]
],
//操作记录
'getDistrictList'
=>
[
'index/district/getDistrictList'
,
[
'method'
=>
'get'
]
],
//总监列表
'adddistrict'
=>
[
'index/district/addDistrict'
,
[
'method'
=>
'get|post'
]
],
//添加部门,绑定总监关系
'getDistrictListByName'
=>
[
'index/district/getDistrictListByName'
,
[
'method'
=>
'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