ExportUserListController.class.php
1.92 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 17/10/12
* Time: 20:57
*/
namespace Apicp\Controller\UserData;
use Com\PythonExcel;
use Common\Common\Constant;
use Common\Common\ExportDownload;
use Common\Common\User;
use Common\Common\ExamHelper;
use Common\Common\CourseHelper;
use Common\Model\CourseArticleModel;
use Common\Model\CourseCompleteModel;
use Common\Model\CourseStudyTimeModel;
class ExportUserListController extends \Apicp\Controller\AbstractController
{
/**
* ExportUserList
* @author liyifei
* @desc 导出员工数据总览
* @param String dp_ids 组织ID(多个值时,以英文逗号分隔)
* @param String role_ids 角色ID(多个值时,以英文逗号分隔)
* @param String job_ids 岗位ID(多个值时,以英文逗号分隔)
* @param String username 姓名
* @return void
*/
public function Index_post()
{
$postData = I('post.');
$title = '员工数据总览_' . rgmdate(MILLI_TIME, 'YmdHi');
$params_down = [
'title' => $title,
'ea_id' => $this->_login->user['eaId'],
'username' => $this->_login->user['eaRealname'],
'type' => ExportDownload::ZIP_TYPE
];
// 新增开始生成状态
$id = ExportDownload::set_down_load($params_down);
$params = [
'user_id' => $this->_login->user['eaId'],
'time' => microtime(true),
'id' => $id,
'username' => $postData['username'],
'dp_ids' => $postData['dp_ids'],
'role_ids' => $postData['role_ids'],
'job_ids' => $postData['job_ids'],
'page' => 1
];
$url = oaUrl('Frontend/Callback/ExportUserDataList');
// 生成定时任务
ExportDownload::set_Cron($params, $url, '员工数据总览_批量下载', 'USER_DATA_DOWN_Excel_' . $id);
$this->_result = [];
}
}