info.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. $status = Dever::config('base')->status;
  3. # 每页的数据量
  4. $page = 10;
  5. $type = array
  6. (
  7. 1 => '分享活动',
  8. 2 => '推广员',
  9. );
  10. # 常用的col
  11. $col = '*';
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'info',
  16. # 显示给用户看的名称
  17. 'lang' => '活动管理',
  18. 'order' => 99,
  19. 'check' => 'type',
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'list' => true,
  31. ),
  32. 'name' => array
  33. (
  34. 'type' => 'varchar-80',
  35. 'name' => '标题-活动标题,同时也用于分享标题',
  36. 'default' => '',
  37. 'desc' => '标题',
  38. 'match' => 'is_string',
  39. 'update' => 'text',
  40. 'list' => true,
  41. 'search' => 'fulltext',
  42. //增加预览
  43. 'preview' => true,
  44. ),
  45. 'desc' => array
  46. (
  47. 'type' => 'varchar-500',
  48. 'name' => '摘要-活动摘要,同时也用于分享内容',
  49. 'default' => '',
  50. 'desc' => '摘要',
  51. 'match' => 'is_string',
  52. 'update' => 'textarea',
  53. ),
  54. 'cover' => array
  55. (
  56. 'type' => 'varchar-150',
  57. 'name' => '封面图',
  58. 'default' => '',
  59. 'desc' => '封面图',
  60. 'match' => 'option',
  61. 'update' => 'image',
  62. 'key' => '1',
  63. 'place' => '750*722',
  64. ),
  65. 'color' => array
  66. (
  67. 'type' => 'varchar-10',
  68. 'name' => '按钮颜色-请填写颜色代码,选填项',
  69. 'default' => '',
  70. 'desc' => '按钮颜色',
  71. 'match' => 'option',
  72. 'update' => 'color',
  73. ),
  74. 'bgcolor' => array
  75. (
  76. 'type' => 'varchar-10',
  77. 'name' => '背景颜色-请填写颜色代码,选填项',
  78. 'default' => '',
  79. 'desc' => '背景颜色',
  80. 'match' => 'option',
  81. 'update' => 'color',
  82. ),
  83. 'back' => array
  84. (
  85. 'type' => 'varchar-150',
  86. 'name' => '背景图',
  87. 'default' => '',
  88. 'desc' => '背景图',
  89. 'match' => 'option',
  90. 'update' => 'image',
  91. 'key' => '1',
  92. ),
  93. 'type' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '活动类型',
  97. 'default' => '1',
  98. 'desc' => '活动类型',
  99. 'match' => 'is_numeric',
  100. 'update' => 'select',
  101. 'option' => $type,
  102. 'search' => 'radio',
  103. 'list' => true,
  104. ),
  105. 'content' => array
  106. (
  107. 'type' => 'text-255',
  108. 'name' => '活动规则内容',
  109. 'default' => '',
  110. 'desc' => '请输入内容',
  111. 'match' => 'is_string',
  112. 'update' => 'editor',
  113. 'key' => '1',
  114. ),
  115. 'reorder' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '排序-数值越大越靠前,相当于置顶',
  119. 'default' => '1',
  120. 'desc' => '请输入排序',
  121. 'match' => 'option',
  122. //'update' => 'text',
  123. 'search' => 'order',
  124. 'list' => true,
  125. 'order' => 'desc',
  126. 'edit' => true,
  127. ),
  128. 'state' => array
  129. (
  130. 'type' => 'tinyint-1',
  131. 'name' => '状态',
  132. 'default' => '1',
  133. 'desc' => '请选择状态',
  134. 'match' => 'is_numeric',
  135. ),
  136. 'cdate' => array
  137. (
  138. 'type' => 'int-11',
  139. 'name' => '录入时间',
  140. 'match' => array('is_numeric', time()),
  141. 'desc' => '',
  142. # 只有insert时才生效
  143. 'insert' => true,
  144. ),
  145. ),
  146. # 默认值
  147. 'default' => array
  148. (
  149. 'col' => 'name,type,state,cdate',
  150. 'value' => array
  151. (
  152. '"分享领取优惠券活动",1,1,' . time(),
  153. '"推广员营销活动",2,1,' . time(),
  154. ),
  155. ),
  156. # 管理功能
  157. 'manage' => array
  158. (
  159. //'insert' => false,
  160. //'edit' => false,
  161. 'delete' => false,
  162. # 列表
  163. 'list_button' => array
  164. (
  165. //'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
  166. ),
  167. ),
  168. # request 请求接口定义
  169. 'request' => array
  170. (
  171. 'search' => array
  172. (
  173. # 匹配的正则或函数 选填项
  174. 'option' => array
  175. (
  176. 'ids' => array('yes-id', 'in'),
  177. 'cate_id' => 'yes',
  178. 'name' => array('yes', 'like'),
  179. 'id' => 'yes',
  180. 'state' => 1,
  181. ),
  182. 'type' => 'all',
  183. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  184. 'limit' => '0,10',
  185. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  186. ),
  187. 'getAll' => array
  188. (
  189. # 匹配的正则或函数 选填项
  190. 'option' => array
  191. (
  192. 'state' => 1,
  193. ),
  194. 'type' => 'all',
  195. 'order' => array('id' => 'asc'),
  196. 'col' => '*,id as value',
  197. ),
  198. ),
  199. );