DeleteController.class.php
782 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: liyifei2012it
* Date: 16/9/17
* Time: 23:14
*/
namespace Apicp\Controller\Department;
use VcySDK\Service;
use VcySDK\Department;
class DeleteController extends AbstractController
{
/**
* 【通讯录】删除部门
* @author liyifei
* @time 2016-09-20 18:57:18
*/
public function Index_post()
{
$id = I('post.department_id', '', 'trim');
if (!$this->_managePower()) {
E('_ERR_ADMIN_PERMISSION_DENIED');
}
if (empty($id)) {
E('_ERR_DEPARTMENT_ID_IS_NULL');
}
$dpServ = new Department(Service::instance());
$dpServ->delete(['dpId' => $id]);
$this->clearDepartmentCache();
return true;
}
}