DeleteController.class.php
915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* DeleteController.class.php
* 删除我的收藏
* @author Xtong
* @version $Id$
*/
namespace Api\Controller\Collection;
use Common\Model\CommonCollectionModel;
use Common\Service\CommonCollectionService;
class DeleteController extends AbstractController
{
public function before_action($action = '')
{
if (!parent::before_action($action)) {
return false;
}
return true;
}
/**
* 删除我的收藏
*
* @return array
*/
public function Index()
{
$collection_id = I('post.collection_id');
$conds = [
'c_deleted' => CommonCollectionModel::DELETE_YES,
'collection_id' => $collection_id,
'uid' => $this->uid
];
$collectionService = new CommonCollectionService();
$collectionService->delete_by_conds($conds);
return true;
}
}