DeleteController.class.php
992 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
<?php
/**
* Created by PhpStorm.
* User: tangxingguo
* Date: 2017/4/27
* Time: 10:59
*/
namespace Apicp\Controller\Award;
use Com\PackageValidate;
use Common\Service\AwardService;
use Common\Service\RightService;
class DeleteController extends \Apicp\Controller\AbstractController
{
/**
* Delete
* @author tangxingguo
* @desc 删除激励
* @param array award_ids:true 激励ID数组
*/
public function Index_post()
{
// 验证规则
$rules = [
'award_ids' => 'require|array',
];
// 验证数据
$validate = new PackageValidate($rules, [], array_keys($rules));
$awardIds = $postData = $validate->postData['award_ids'];
// 删除激励
$awardServ = new AwardService();
$awardServ->delete_by_conds(['award_id' => $awardIds]);
// 删除权限
$rightServ = new RightService();
$rightServ->delete_by_conds(['award_id' => $awardIds]);
}
}