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
5b285d12
Commit
5b285d12
authored
Sep 06, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delAmercementImage
parent
9c9fa37b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
4 deletions
+55
-4
Amercement.php
application/index/controller/Amercement.php
+16
-0
AmercementService.php
application/index/service/AmercementService.php
+18
-1
AmercementValidate.php
application/index/validate/AmercementValidate.php
+5
-3
OAmercementImgModel.php
application/model/OAmercementImgModel.php
+15
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Amercement.php
View file @
5b285d12
...
...
@@ -143,4 +143,19 @@ class Amercement extends Basic
}
/**
* 删除图片
* @return \think\Response
*/
public
function
delAmercementImage
(){
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"AmercementValidate.delAmercementImage"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$res
=
$this
->
s_amercement
->
delAmercementImage
(
$params
[
'id'
]);
//int(1)
return
$this
->
response
(
"200"
,
"成功"
,[
'data'
=>
$res
]);
}
}
\ No newline at end of file
application/index/service/AmercementService.php
View file @
5b285d12
...
...
@@ -188,7 +188,7 @@ class AmercementService
* @param $agent_id
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @return
array|
false|\PDOStatement|string|\think\Collection
*/
public
function
getAmercementList
(
$status
,
$amercement_type
,
$agent_id
,
$page_no
,
$page_size
)
{
...
...
@@ -201,6 +201,10 @@ class AmercementService
}
$condition
[
'status'
]
=
$status
;
$result
=
$this
->
m_amercement
->
getAmercementList
(
$condition
,
$field
,
$page_no
,
$page_size
);
if
(
!
$result
){
return
[];
}
$redis_cache
=
new
RedisCacheService
();
foreach
(
$result
as
$key
=>
$val
)
{
...
...
@@ -581,5 +585,17 @@ class AmercementService
}
/**
* 删除图片
* @param $id
* @return int|string
*/
public
function
delAmercementImage
(
$id
){
$params_
[
'status'
]
=
1
;
$res
=
$this
->
m_amercement_img
->
updateImage
(
$id
,
$params_
);
//int(1)
return
$res
;
}
}
\ No newline at end of file
application/index/validate/AmercementValidate.php
View file @
5b285d12
...
...
@@ -59,9 +59,10 @@ class AmercementValidate extends Validate {
];
protected
$scene
=
[
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'getAmercementInfo'
=>
[
'id'
],
'editAmercement'
=>
[
'id'
,
'edit_type'
],
'addAmercement'
=>
[
'type'
,
'money'
,
'agent_id'
,
'remarks'
,
'img'
],
'getAmercementInfo'
=>
[
'id'
],
'editAmercement'
=>
[
'id'
,
'edit_type'
],
'delAmercementImage'
=>
[
'id'
],
];
}
\ No newline at end of file
application/model/OAmercementImgModel.php
View file @
5b285d12
...
...
@@ -36,5 +36,20 @@ class OAmercementImgModel extends Model
}
/**
* 更新数据
* @param $id
* @param $params
* @return int|string
*/
public
function
updateImage
(
$id
,
$params
)
{
$result
=
$this
->
db_
->
where
(
'id'
,
$id
)
->
update
(
$params
);
return
$result
;
}
}
application/route.php
View file @
5b285d12
...
...
@@ -590,6 +590,7 @@ Route::group('index', [
'getAmercementListExcel'
=>
[
'index/Amercement/getAmercementListExcel'
,
[
'method'
=>
'GET|POST'
]
],
'getAmercementInfo'
=>
[
'index/Amercement/getAmercementInfo'
,
[
'method'
=>
'GET|POST'
]
],
'editAmercement'
=>
[
'index/Amercement/editAmercement'
,
[
'method'
=>
'GET|POST'
]
],
'delAmercementImage'
=>
[
'index/Amercement/delAmercementImage'
,
[
'method'
=>
'GET|POST'
]
],
]);
...
...
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