col.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. $type = array
  3. (
  4. 'text' => '文本框',
  5. 'textarea' => '大文本框',
  6. 'editor' => '编辑器',
  7. 'image' => '图片',
  8. );
  9. $source = array
  10. (
  11. 1 => '自建数据库',
  12. 2 => '网络API',
  13. 3 => '数据采集系统[未开通]',
  14. );
  15. return array
  16. (
  17. # 表名
  18. 'name' => 'col',
  19. # 显示给用户看的名称
  20. 'lang' => '字段管理',
  21. 'order' => 20,
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => 'ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'search' => 'fulltext',
  33. 'order' => 'desc',
  34. 'list' => true,
  35. ),
  36. 'name' => array
  37. (
  38. 'type' => 'varchar-60',
  39. 'name' => '字段名称',
  40. 'default' => '',
  41. 'desc' => '请填写字段名称',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. 'list' => true,
  45. ),
  46. 'source' => array
  47. (
  48. 'type' => 'tinyint-1',
  49. 'name' => '数据来源',
  50. 'default' => '',
  51. 'desc' => '数据来源',
  52. 'match' => 'is_numeric',
  53. 'option' => $source,
  54. 'update' => 'select',
  55. 'search' => 'select',
  56. 'list' => true,
  57. 'show' => 'source',
  58. ),
  59. 'type' => array
  60. (
  61. 'type' => 'varchar-60',
  62. 'name' => '字段类型',
  63. 'default' => '',
  64. 'desc' => '字段类型',
  65. 'match' => 'is_string',
  66. 'option' => $type,
  67. 'update' => 'select',
  68. 'search' => 'select',
  69. 'list' => true,
  70. ),
  71. 'state' => array
  72. (
  73. 'type' => 'tinyint-1',
  74. 'name' => '状态',
  75. 'default' => '1',
  76. 'desc' => '请选择状态',
  77. 'match' => 'is_numeric',
  78. ),
  79. 'cdate' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '录入时间',
  83. 'match' => array('is_numeric', time()),
  84. 'desc' => '',
  85. # 只有insert时才生效
  86. 'insert' => true,
  87. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  88. ),
  89. ),
  90. 'manage' => array
  91. (
  92. 'list_button' => array
  93. (
  94. 'addData' => array('新增数据', '"data&search_option_col_id={id}&oper_parent=col"', '{source}==1'),
  95. 'listData' => array('数据列表', '"data&search_option_col_id={id}&oper_parent=col"'),
  96. //'listData' => array('数据列表', '"data&project=content&search_option_col_id={id}&opers_save_jump=company&oper_parent=company&oper_key=service"'),
  97. ),
  98. ),
  99. # request 请求接口定义
  100. 'request' => array
  101. (
  102. 'get' => array
  103. (
  104. 'where' => array
  105. (
  106. 'name' => array('yes', 'in'),
  107. 'state' => 1,
  108. ),
  109. 'type' => 'all',
  110. ),
  111. ),
  112. );