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
aacfcb59
Commit
aacfcb59
authored
Aug 31, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c端图库-删除
parent
0098091f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
ImageDepot.php
application/api/controller/ImageDepot.php
+69
-0
GImageDepot.php
application/model/GImageDepot.php
+13
-0
No files found.
application/api/controller/ImageDepot.php
View file @
aacfcb59
...
@@ -153,6 +153,75 @@ class ImageDepot extends Basic
...
@@ -153,6 +153,75 @@ class ImageDepot extends Basic
return
$this
->
response
(
"200"
,
"成功"
,
$data
);
return
$this
->
response
(
"200"
,
"成功"
,
$data
);
}
}
/**
* 删除
* @return \think\Response
*/
public
function
delImageDepot
(){
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"ImageDepot.getImageDepotById"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$params_
[
'img_status'
]
=
1
;
$res
=
$this
->
imageDepot
->
updateImageDepot
(
$params
[
'id'
],
$params_
);
//int(1)
if
(
$res
==
1
){
return
$this
->
response
(
"200"
,
"成功"
,[
'data'
=>
$res
]);
}
else
{
return
$this
->
response
(
"300"
,
"失败"
);
}
}
/**
* 获取随机图片
* @return \think\Response
*/
public
function
getImageWidthRand
(
$img_type
,
$label
)
{
if
(
$img_type
==
0
)
{
}
elseif
(
$img_type
==
1
)
{
}
else
{
}
//todo 根据条件 查询所有符合要求的记录的ID
if
(
!
empty
(
$params
[
'label'
]))
{
$params_
[
'label'
]
=
[
'LIKE'
,
'%'
.
$params
[
'label'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'img_type'
]))
{
$params_
[
'img_type'
]
=
$params
[
'img_type'
];
}
/*$params = array(
"agents_id" => 5740
);*/
/**
`id`
`img_type` '图片类型:0室外图 ,1室内图 ,2人群图',
`label_type` '业态标签:0商场美食、1沿街餐饮、2百货零售、3服饰鞋包、4休闲娱乐、5亲子教育、6百货超市、7办公',
`img_name` '图片名称',
`img_status` '删除状态 0正常 1删除',
`update_time` '更新时间',
`create_time` '创建时间',
*/
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
'id,img_type,label,img_name,create_time'
;
$params_
[
'img_status'
]
=
0
;
$res
=
$this
->
imageDepot
->
getImageDepotList
(
$field
,
$params_
,
$pageNo
,
$pageSize
);
//
}
}
}
...
...
application/model/GImageDepot.php
View file @
aacfcb59
...
@@ -72,4 +72,17 @@ class GImageDepot extends Model
...
@@ -72,4 +72,17 @@ class GImageDepot extends Model
//dump($this->getLastSql());
//dump($this->getLastSql());
return
$result
;
return
$result
;
}
}
/**
* 更新数据
*/
public
function
updateImageDepot
(
$id
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
where
(
'id'
,
$id
)
->
update
(
$params
);
//dump($this->getLastSql());
return
$result
;
}
}
}
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