code.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已生成',
  5. 2 => '已绑定',
  6. 3 => '已兑换',
  7. 4 => '已使用',
  8. 5 => '已过期',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'code',
  14. # 显示给用户看的名称
  15. 'lang' => '礼品卡卡号',
  16. 'status' => $status,
  17. # 后台菜单排序
  18. 'order' => 99,
  19. 'menu' => false,
  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. 'search' => 'order',
  31. 'list' => true,
  32. 'order' => 'desc',
  33. ),
  34. 'card_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '礼品卡',
  38. 'default' => '',
  39. 'desc' => '礼品卡',
  40. 'match' => 'is_numeric',
  41. 'update' => 'hidden',
  42. 'value' => Dever::input('search_option_card_id'),
  43. 'list' => 'Dever::load("card/info-find#name", "{card_id}")',
  44. ),
  45. 'card' => array
  46. (
  47. 'type' => 'varchar-32',
  48. 'name' => '卡号',
  49. 'default' => '',
  50. 'desc' => '卡号',
  51. 'match' => 'is_string',
  52. 'update' => 'text',
  53. 'search' => 'fulltext',
  54. 'list' => true,
  55. ),
  56. 'status' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '使用状态',
  60. 'default' => '1',
  61. 'desc' => '使用状态',
  62. 'match' => 'is_numeric',
  63. 'option' => $status,
  64. 'search' => 'select',
  65. 'update' => 'select',
  66. 'list' => true,
  67. //'mul' => array(1 => '恢复使用', 4 => '已作废'),
  68. ),
  69. 'total_cash' => array
  70. (
  71. 'type' => 'varchar-50',
  72. 'name' => '总额',
  73. 'default' => '',
  74. 'desc' => '总额',
  75. 'match' => 'option',
  76. 'update' => 'text',
  77. ),
  78. 'use_cash' => array
  79. (
  80. 'type' => 'varchar-50',
  81. 'name' => '已使用',
  82. 'default' => '',
  83. 'desc' => '已使用',
  84. 'match' => 'option',
  85. 'update' => 'text',
  86. ),
  87. 'uid' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '用户信息',
  91. 'default' => '0',
  92. 'desc' => '用户信息',
  93. 'match' => 'is_numeric',
  94. 'list_name' => '兑换信息',
  95. //'list' => 'Dever::load("goods/lib/manage.showUserInfo", "{id}")',
  96. ),
  97. 'shop_id' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '兑换门店',
  101. 'default' => '',
  102. 'desc' => '兑换门店',
  103. 'match' => 'is_numeric',
  104. ),
  105. 'order_id' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '订单表id',
  109. 'default' => '',
  110. 'desc' => '订单表id',
  111. 'match' => 'is_numeric',
  112. ),
  113. 'order_card_id' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '订单表id',
  117. 'default' => '',
  118. 'desc' => '订单表id',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'bdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '绑定时间',
  125. 'match' => 'option',
  126. 'default' => '',
  127. 'desc' => '',
  128. //'search' => 'date',
  129. ),
  130. 'ddate' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '兑换时间',
  134. 'match' => 'option',
  135. 'default' => '',
  136. 'desc' => '',
  137. //'search' => 'date',
  138. ),
  139. 'edate' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '失效时间',
  143. 'match' => 'is_numeric',
  144. 'default' => '',
  145. 'desc' => '',
  146. 'list' => 'date("Y-m-d H:i:s", {edate})',
  147. ),
  148. 'state' => array
  149. (
  150. 'type' => 'tinyint-1',
  151. 'name' => '状态',
  152. 'default' => '1',
  153. 'desc' => '请选择状态',
  154. 'match' => 'is_numeric',
  155. ),
  156. 'cdate' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '生成时间',
  160. 'match' => array('is_numeric', time()),
  161. 'desc' => '',
  162. # 只有insert时才生效
  163. 'insert' => true,
  164. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  165. ),
  166. ),
  167. 'manage' => array
  168. (
  169. 'excel' => true,
  170. 'delete' => false,
  171. 'edit' => false,
  172. 'insert' => false,
  173. // 'mul' => '{type} == 1 || {type} == 4',
  174. 'list_button' => array
  175. (
  176. //'oper' => array('作废', 'goods/lib/manage.drop?id={id}', '{type} == 1'),
  177. //'oper2' => array('恢复使用', 'goods/lib/manage.recovery?id={id}', '{type} == 4'),
  178. ),
  179. ),
  180. # 索引
  181. 'index' => array
  182. (
  183. # 索引名 => 索引id
  184. 1 => array
  185. (
  186. 'card' => 'card'
  187. ),
  188. 'version' => 1,
  189. ),
  190. 'request' => array
  191. (
  192. 'getData' => array
  193. (
  194. # 匹配的正则或函数 选填项
  195. 'option' => array
  196. (
  197. 'card_id' => 'yes',
  198. 'status' => 'yes',
  199. 'state' => 1,
  200. ),
  201. 'type' => 'all',
  202. 'limit' => '0,10',
  203. 'order' => array('cdate' => 'asc'),
  204. 'col' => '*',
  205. ),
  206. 'getPageData' => array
  207. (
  208. # 匹配的正则或函数 选填项
  209. 'option' => array
  210. (
  211. 'uid' => 'yes',
  212. 'status' => 'yes',
  213. 'state' => 1,
  214. ),
  215. 'type' => 'all',
  216. 'page' => array(10, 'list'),
  217. 'order' => array('cdate' => 'ddate'),
  218. 'col' => '*,total_cash-use_cash as cash',
  219. ),
  220. ),
  221. );