forked from qmpaas/leadshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExportController.php
98 lines (82 loc) · 2.31 KB
/
ExportController.php
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* 分组管理
* @link https://www.leadshop.vip/
* @copyright Copyright ©2020-2021 浙江禾成云计算有限公司
*/
namespace leadmall\api;
use leadmall\Map;
use basics\api\BasicsController as BasicsModules;
use Yii;
class ExportController extends BasicsModules implements Map
{
public $modules = [
'order' => [
'module' => 'order',
'controller' => 'export',
],
'orderafter' => [
'module' => 'order',
'controller' => 'afterexport',
],
'goods' => [
'module' => 'goods',
'controller' => 'export',
],
'user' => [
'module' => 'users',
'controller' => 'export',
]
];
/**
* 重写父类
* @return [type] [description]
*/
public function actions()
{
$actions = parent::actions();
unset($actions['create']);
unset($actions['update']);
return $actions;
}
public function actionIndex()
{
$include = Yii::$app->request->get('include', '');
$module = $this->modules[$include] ?? false;
if (!$module) {
Error('未定义操作');
}
return $this->runModule($module['module'], $module['controller'], "index");
}
public function actionView()
{
$include = Yii::$app->request->get('include', '');
$module = $this->modules[$include] ?? false;
if (!$module) {
Error('未定义操作');
}
return $this->runModule($module['module'], $module['controller'], "view");
}
public function actionCreate()
{
$include = Yii::$app->request->get('include', '');
$module = $this->modules[$include] ?? false;
if (!$module) {
Error('未定义操作');
}
return $this->runModule($module['module'], $module['controller'], "create");
}
public function actionUpdate()
{
Error('占位方法');
}
public function actionDelete()
{
$include = Yii::$app->request->get('include', '');
$module = $this->modules[$include] ?? false;
if (!$module) {
Error('未定义操作');
}
return $this->runModule($module['module'], $module['controller'], "delete");
}
}