code.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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' => '0',
  74. 'desc' => '总额',
  75. 'match' => 'option',
  76. 'update' => 'text',
  77. ),
  78. 'use_cash' => array
  79. (
  80. 'type' => 'varchar-50',
  81. 'name' => '已使用',
  82. 'default' => '0',
  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("card/lib/manage.showUserInfo", "{id}")',
  96. ),
  97. 'dh_uid' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '兑换用户',
  101. 'default' => '0',
  102. 'desc' => '兑换用户',
  103. 'match' => 'is_numeric',
  104. ),
  105. 'shop_id' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '下单门店',
  109. 'default' => '',
  110. 'desc' => '下单门店',
  111. 'match' => 'is_numeric',
  112. ),
  113. 'order_id' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '订单表id',
  117. 'default' => '',
  118. 'desc' => '订单表id',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'order_card_id' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '订单表id',
  125. 'default' => '',
  126. 'desc' => '订单表id',
  127. 'match' => 'is_numeric',
  128. ),
  129. 'bdate' => array
  130. (
  131. 'type' => 'int-11',
  132. 'name' => '绑定时间',
  133. 'match' => 'option',
  134. 'default' => '',
  135. 'desc' => '',
  136. //'search' => 'date',
  137. ),
  138. 'ddate' => array
  139. (
  140. 'type' => 'int-11',
  141. 'name' => '兑换时间',
  142. 'match' => 'option',
  143. 'default' => '',
  144. 'desc' => '',
  145. //'search' => 'date',
  146. ),
  147. 'state' => array
  148. (
  149. 'type' => 'tinyint-1',
  150. 'name' => '状态',
  151. 'default' => '1',
  152. 'desc' => '请选择状态',
  153. 'match' => 'is_numeric',
  154. ),
  155. 'cdate' => array
  156. (
  157. 'type' => 'int-11',
  158. 'name' => '生成时间',
  159. 'match' => array('is_numeric', time()),
  160. 'desc' => '',
  161. # 只有insert时才生效
  162. 'insert' => true,
  163. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  164. ),
  165. ),
  166. 'manage' => array
  167. (
  168. 'excel' => true,
  169. 'delete' => false,
  170. 'edit' => false,
  171. 'insert' => false,
  172. // 'mul' => '{type} == 1 || {type} == 4',
  173. 'list_button' => array
  174. (
  175. //'oper' => array('作废', 'goods/lib/manage.drop?id={id}', '{type} == 1'),
  176. //'oper2' => array('恢复使用', 'goods/lib/manage.recovery?id={id}', '{type} == 4'),
  177. ),
  178. ),
  179. # 索引
  180. 'index' => array
  181. (
  182. # 索引名 => 索引id
  183. 1 => array
  184. (
  185. 'card' => 'card',
  186. 'uid' => 'uid',
  187. 'dh_uid' => 'dh_uid',
  188. ),
  189. 'version' => 1,
  190. ),
  191. 'request' => array
  192. (
  193. 'getData' => array
  194. (
  195. # 匹配的正则或函数 选填项
  196. 'option' => array
  197. (
  198. 'uid' => 'yes',
  199. 'dh_uid' => 'yes',
  200. 'card_id' => 'yes',
  201. 'status' => 'yes',
  202. 'state' => 1,
  203. ),
  204. 'type' => 'all',
  205. 'limit' => '0,10',
  206. 'order' => array('ddate' => 'desc'),
  207. 'col' => '*',
  208. ),
  209. 'getPageData' => array
  210. (
  211. # 匹配的正则或函数 选填项
  212. 'option' => array
  213. (
  214. 'uid' => 'yes',
  215. 'dh_uid' => 'yes',
  216. 'status' => 'yes',
  217. 'state' => 1,
  218. ),
  219. 'type' => 'all',
  220. 'page' => array(10, 'list'),
  221. 'order' => array('ddate' => 'desc'),
  222. 'col' => '*',
  223. ),
  224. ),
  225. );