pic_grid.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $palaces = array
  4. (
  5. 1 => '上左',
  6. 2 => '上右',
  7. 3 => '下左',
  8. 4 => '下右',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'pic_grid',
  14. # 显示给用户看的名称
  15. 'lang' => '四宫格图片',
  16. 'order' => 100,
  17. 'menu' => false,
  18. 'end' => array
  19. (
  20. 'insert' => 'collection/lib/content.updateTypeId',
  21. 'update' => 'collection/lib/content.updateTypeId',
  22. ),
  23. # 数据结构
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. //'list' => true,
  34. ),
  35. 'info_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '合集',
  39. 'default' => '',
  40. 'desc' => '合集',
  41. 'match' => 'is_numeric',
  42. 'update' => 'hidden',
  43. 'value' => Dever::input('search_option_info_id')
  44. ),
  45. 'content_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '合集内容id',
  49. 'default' => '',
  50. 'desc' => '合集内容id',
  51. 'match' => 'is_numeric',
  52. 'update' => 'hidden',
  53. 'value' => Dever::input('search_option_content_id')
  54. ),
  55. 'text' => array
  56. (
  57. 'type' => 'text-1000',
  58. 'name' => '四宫格图片',
  59. 'default' => '',
  60. 'desc' => '四宫格图片',
  61. 'match' => 'is_string',
  62. 'option' => $palaces,
  63. 'show' => 'type=13',
  64. 'list' => 'Dever::load("content/lib/manage.picGrid", "{text}")',
  65. 'update' => array
  66. (
  67. array
  68. (
  69. 'col' => 'pic',
  70. 'name' => '图片',
  71. 'default' => '',
  72. 'desc' => '图片',
  73. 'match' => 'is_string',
  74. 'update' => 'image',
  75. 'key' => 1,
  76. ),
  77. ),
  78. ),
  79. 'udate' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '更新时间',
  83. 'match' => array('is_numeric', time()),
  84. 'desc' => '',
  85. ),
  86. 'status' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '发布状态',
  90. 'default' => '1',
  91. 'desc' => '发布状态',
  92. 'match' => 'is_numeric',
  93. //'update' => 'select',
  94. 'option' => $status,
  95. //'search' => 'select',
  96. //'list' => true,
  97. //'edit' => true,
  98. ),
  99. 'reorder' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '排序(数值越大越靠前)',
  103. 'default' => '1',
  104. 'desc' => '请输入排序',
  105. 'match' => 'option',
  106. //'update' => 'text',
  107. 'search' => 'order',
  108. 'list' => true,
  109. 'order' => 'desc',
  110. 'edit' => true,
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => 'is_numeric',
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '录入时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. ),
  129. ),
  130. # 管理功能
  131. 'manage' => array
  132. (
  133. ),
  134. # request 请求接口定义
  135. 'request' => array
  136. (
  137. 'getAll' => array
  138. (
  139. # 匹配的正则或函数 选填项
  140. 'option' => array
  141. (
  142. 'info_id' => 'yes',
  143. 'content_id' => 'yes',
  144. 'state' => 1,
  145. ),
  146. 'type' => 'all',
  147. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  148. 'col' => '*',
  149. ),
  150. ),
  151. );