forked from yuan1994/tpAdmin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate.php
86 lines (84 loc) · 2.71 KB
/
generate.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
<?php
return [
'module' => 'admin',
'controller' => 'Test',
'title' => '测试',
'form' => [
[
'title' => '字段一',
'name' => 'field1',
'type' => 'radio',
'option' => '1:值一#2:值二#3:值三',
'default' => '默认值',
'sort' => false,
'search' => true,
'search_type' => 'select',
'require' => true,
'validate' => [
'datatype' => '*',
'nullmsg' => '为空信息',
'errormsg' => '错误信息',
],
],
[
'title' => '字段一',
'name' => 'field2',
'type' => 'date',
'option' => '1:值一#2:值二#3:值三',
'default' => '2',
'sort' => true,
'search' => true,
'search_type' => 'text',
'require' => true,
'validate' => [
'datatype' => 'n',
'nullmsg' => '为空信息',
'errormsg' => '错误信息',
],
],
[
'title' => '状态',
'name' => 'status',
'type' => 'radio',
'option' => '1:启用#0:禁用',
'default' => '0',
'sort' => false,
'search' => false,
'search_type' => 'select',
'require' => true,
'validate' => [
'datatype' => 'n',
'nullmsg' => '为空信息',
'errormsg' => '错误信息',
],
],
],
'create_table' => true,
'create_table_force' => false,
'table_name' => '',
'table_engine' => 'InnoDB',
'field' => [
[
'name' => 'field1',
'type' => 'varchar(25)',
'default' => 123,
'not_null' => true,
'key' => true,
'comment' => '',
'extra' => '', // 扩展属性,例如AUTO_INCREMENT
],
[
'name' => 'field2',
'type' => 'varchar(255)',
'default' => 123,
'allow_null' => true,
'key' => true,
'comment' => '',
'extra' => '', // 扩展属性,例如AUTO_INCREMENT
],
],
'menu' => ['add', 'forbid', 'resume', 'delete', 'recyclebin'],
'auto_timestamp' => true,
'model' => false,
'validate' => false,
];