info.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?php
  2. $status = array
  3. (
  4. 1 => '可用',
  5. 2 => '禁用',
  6. );
  7. $cate = function()
  8. {
  9. $array = array();
  10. $info = Dever::db('quan/cate')->state();
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. $score = function()
  18. {
  19. $array = array();
  20. $info = Dever::load('score/lib/core')->getScore();
  21. if($info)
  22. {
  23. $array += $info;
  24. }
  25. return $array;
  26. };
  27. $function = array
  28. (
  29. 1 => '消耗积分',
  30. 2 => '赠送积分',
  31. 3 => '满减积分',
  32. 4 => '推荐',
  33. 5 => '等级',
  34. 6 => '提现',
  35. 11 => '赠送券',
  36. );
  37. return array
  38. (
  39. # 表名
  40. 'name' => 'info',
  41. # 显示给用户看的名称
  42. 'lang' => '券管理',
  43. 'order' => 100,
  44. # 数据结构
  45. 'struct' => array
  46. (
  47. 'id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => 'ID',
  51. 'default' => '',
  52. 'desc' => '',
  53. 'match' => 'is_numeric',
  54. 'list' => true,
  55. ),
  56. 'name' => array
  57. (
  58. 'type' => 'varchar-80',
  59. 'name' => '券名称',
  60. 'default' => '',
  61. 'desc' => '券名称',
  62. 'match' => 'is_string',
  63. 'update' => 'text',
  64. 'list' => true,
  65. 'search' => 'fulltext',
  66. ),
  67. 'cate_id' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '所属分类',
  71. 'default' => '1',
  72. 'desc' => '所属分类',
  73. 'match' => 'is_numeric',
  74. 'update' => 'select',
  75. 'option' => $cate,
  76. 'search' => 'select',
  77. 'list' => 'Dever::load("quan/cate-one#name", {cate_id})',
  78. ),
  79. 'desc' => array
  80. (
  81. 'type' => 'varchar-500',
  82. 'name' => '券描述',
  83. 'default' => '',
  84. 'desc' => '券描述',
  85. 'match' => 'option',
  86. 'update' => 'textarea',
  87. ),
  88. 'value' => array
  89. (
  90. 'type' => 'varchar-80',
  91. 'name' => '券面值',
  92. 'default' => '',
  93. 'desc' => '券面值',
  94. 'match' => 'is_string',
  95. 'update' => 'text',
  96. 'list' => true,
  97. ),
  98. 'qtime' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '有效期-直接填写天数即可,如有效期为10天,直接填写10',
  102. 'default' => '',
  103. 'desc' => '有效期',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. ),
  107. 'qdate' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '截止时间-选择时间',
  111. 'default' => '',
  112. 'desc' => '截止时间',
  113. 'match' => 'option',
  114. 'update' => 'date',
  115. 'callback' => 'maketime',
  116. ),
  117. 'icon' => array
  118. (
  119. 'type' => 'varchar-150',
  120. 'name' => '1:1图标-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  121. 'default' => '',
  122. 'desc' => '1图标',
  123. 'match' => 'option',
  124. 'update' => 'image',
  125. 'key' => '1',
  126. 'place' => '150',
  127. //直接上传到云端
  128. //'upload' => 'qiniu',
  129. //上传大数据
  130. //'large' => true,
  131. ),
  132. 'function' => array
  133. (
  134. 'type' => 'varchar-30',
  135. 'name' => '功能选择',
  136. 'default' => '1',
  137. 'desc' => '功能选择',
  138. 'match' => 'is_string',
  139. 'update' => 'checkbox',
  140. 'option' => $function,
  141. 'control' => 'function',
  142. ),
  143. 'xh_score' => array
  144. (
  145. 'type' => 'varchar-30',
  146. 'name' => '消耗积分',
  147. 'default' => '',
  148. 'desc' => '消耗积分',
  149. 'match' => 'is_string',
  150. 'update' => 'checkbox',
  151. 'option' => $score,
  152. 'show' => 'function=1',
  153. ),
  154. 'reorder' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '排序(数值越大越靠前)',
  158. 'default' => '1',
  159. 'desc' => '请输入排序',
  160. 'match' => 'option',
  161. 'update' => 'text',
  162. 'search' => 'order',
  163. 'list' => true,
  164. 'order' => 'desc',
  165. 'edit' => true,
  166. ),
  167. 'content' => array
  168. (
  169. 'type' => 'text-255',
  170. 'name' => '内容介绍',
  171. 'default' => '',
  172. 'desc' => '请输入内容',
  173. 'match' => 'is_string',
  174. 'update' => 'editor',
  175. 'key' => '1',
  176. ),
  177. 'status' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '发布状态',
  181. 'default' => '2',
  182. 'desc' => '发布状态',
  183. 'match' => 'is_numeric',
  184. //'update' => 'select',
  185. 'option' => $status,
  186. 'search' => 'select',
  187. 'list' => true,
  188. 'edit' => true,
  189. ),
  190. 'state' => array
  191. (
  192. 'type' => 'tinyint-1',
  193. 'name' => '状态',
  194. 'default' => '1',
  195. 'desc' => '请选择状态',
  196. 'match' => 'is_numeric',
  197. ),
  198. 'admin' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '操作人',
  202. 'default' => '1',
  203. 'desc' => '操作人',
  204. 'match' => 'is_numeric',
  205. ),
  206. 'udate' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '更新时间',
  210. 'match' => array('is_numeric', time()),
  211. 'desc' => '',
  212. ),
  213. 'cdate' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => '录入时间',
  217. 'match' => array('is_numeric', time()),
  218. 'desc' => '',
  219. # 只有insert时才生效
  220. 'insert' => true,
  221. ),
  222. ),
  223. # 索引
  224. 'index' => array
  225. (
  226. 'version' => 1,
  227. 1 => array
  228. (
  229. 'i1' => 'cate_id,reorder',
  230. )
  231. ),
  232. # 管理功能
  233. 'manage' => array
  234. (
  235. ),
  236. # request 请求接口定义
  237. 'request' => array
  238. (
  239. 'search' => array
  240. (
  241. # 匹配的正则或函数 选填项
  242. 'option' => array
  243. (
  244. 'ids' => array('yes-id', 'in'),
  245. 'cate_id' => 'yes',
  246. 'name' => array('yes', 'like'),
  247. 'id' => 'yes',
  248. 'state' => 1,
  249. ),
  250. 'type' => 'all',
  251. 'order' => array('reorder' => 'desc', 'pdate' => 'desc'),
  252. 'limit' => '0,1000',
  253. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  254. ),
  255. ),
  256. );