info.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. $type = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('short/type')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $host = function()
  13. {
  14. $array = array();
  15. $info = Dever::db('short/host')->state();
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. return array
  23. (
  24. # 表名
  25. 'name' => 'info',
  26. # 显示给用户看的名称
  27. 'lang' => '短域名',
  28. # 是否显示在后台菜单
  29. 'order' => 1,
  30. 'auto' => 10000000,
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'order' => 'asc',
  42. 'list' => true,
  43. ),
  44. 'host_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '域名',
  48. 'default' => '1',
  49. 'desc' => '域名',
  50. 'match' => 'is_numeric',
  51. 'update' => 'select',
  52. 'option' => $host,
  53. //'search' => 'select',
  54. //'list' => true,
  55. ),
  56. 'type_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '分类',
  60. 'default' => '1',
  61. 'desc' => '分类',
  62. 'match' => 'is_numeric',
  63. 'update' => 'select',
  64. 'option' => $type,
  65. 'search' => 'select',
  66. 'list' => true,
  67. ),
  68. 'name' => array
  69. (
  70. 'type' => 'varchar-600',
  71. 'name' => '标题',
  72. 'default' => '',
  73. 'desc' => '标题',
  74. 'match' => 'option',
  75. 'update' => 'text',
  76. 'search' => 'fulltext',
  77. 'list' => true,
  78. ),
  79. 'url' => array
  80. (
  81. 'type' => 'varchar-800',
  82. 'name' => '需要转换的网址',
  83. 'default' => '',
  84. 'desc' => '需要转换的网址',
  85. 'match' => 'is_string',
  86. 'update' => 'text',
  87. 'search' => 'fulltext',
  88. 'list' => true,
  89. ),
  90. 'param' => array
  91. (
  92. 'type' => 'varchar-2000',
  93. 'name' => '参数',
  94. 'default' => '',
  95. 'desc' => '参数',
  96. 'match' => 'option',
  97. //'update' => 'text',
  98. //'list' => true,
  99. 'list_name' => '短连接',
  100. 'list' => 'Dever::load("short/lib/handle.showUrl", {id})',
  101. ),
  102. 'key' => array
  103. (
  104. 'type' => 'varchar-32',
  105. 'name' => '关键字',
  106. 'default' => '',
  107. 'desc' => '关键字',
  108. 'match' => 'option',
  109. //'update' => 'text',
  110. //'search' => 'fulltext',
  111. //'list' => true,
  112. ),
  113. 'state' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '状态',
  117. 'default' => '1',
  118. 'desc' => '请选择状态',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'cdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '录入时间',
  125. 'match' => array('is_numeric', time()),
  126. 'desc' => '',
  127. # 只有insert时才生效
  128. 'insert' => true,
  129. 'search' => 'date',
  130. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  131. ),
  132. ),
  133. 'manage' => array
  134. (
  135. ),
  136. 'request' => array
  137. (
  138. )
  139. );