ExportController.class.php 745 Bytes
<?php
/**
 * Created by IntelliJ IDEA.
 * User: zhuxun37
 * Date: 2017/5/16
 * Time: 下午6:12
 */

namespace Apicp\Controller\Department;

use Common\Common\Department;
use Common\Service\DepartmentService;

class ExportController extends AbstractController
{

    public function Index_post()
    {
        $dp_ids = [];

        // 取出管理员可见部门ID和子部门ID
        if (!empty($this->_login->role['readDpIdList'])) {
            $dpServ = &Department::instance();
            $dp_ids = $dpServ->list_childrens_by_cdid($this->_login->role['readDpIdList'], true);
        }

        $departmentService = new DepartmentService();
        $departmentService->export($dp_ids, $this->_login->user);

        return true;
    }

}