code.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. 'check' => 'card',
  18. # 后台菜单排序
  19. 'order' => 99,
  20. 'menu' => false,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. 'list' => true,
  33. 'order' => 'desc',
  34. ),
  35. 'card_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_card_id'),
  44. 'list' => 'Dever::load("card/info-find#name", "{card_id}")',
  45. ),
  46. 'card' => array
  47. (
  48. 'type' => 'varchar-32',
  49. 'name' => '卡号',
  50. 'default' => '',
  51. 'desc' => '卡号',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. 'search' => 'fulltext',
  55. 'list' => true,
  56. ),
  57. 'status' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '使用状态',
  61. 'default' => '1',
  62. 'desc' => '使用状态',
  63. 'match' => 'is_numeric',
  64. 'option' => $status,
  65. 'search' => 'select',
  66. 'update' => 'select',
  67. 'list' => true,
  68. //'mul' => array(1 => '恢复使用', 4 => '已作废'),
  69. ),
  70. 'total_cash' => array
  71. (
  72. 'type' => 'varchar-50',
  73. 'name' => '总额',
  74. 'default' => '0',
  75. 'desc' => '总额',
  76. 'match' => 'option',
  77. 'update' => 'text',
  78. ),
  79. 'use_cash' => array
  80. (
  81. 'type' => 'varchar-50',
  82. 'name' => '已使用',
  83. 'default' => '0',
  84. 'desc' => '已使用',
  85. 'match' => 'option',
  86. 'update' => 'text',
  87. ),
  88. 'uid' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '下单用户',
  92. 'default' => '0',
  93. 'desc' => '下单用户',
  94. 'match' => 'is_numeric',
  95. 'list_name' => '更多信息',
  96. 'list' => 'Dever::load("card/lib/manage.showUserInfo", "{id}")',
  97. ),
  98. 'dh_uid' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '兑换用户',
  102. 'default' => '0',
  103. 'desc' => '兑换用户',
  104. 'match' => 'is_numeric',
  105. ),
  106. 'shop_id' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '下单门店',
  110. 'default' => '',
  111. 'desc' => '下单门店',
  112. 'match' => 'is_numeric',
  113. ),
  114. 'order_id' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '订单表id',
  118. 'default' => '',
  119. 'desc' => '订单表id',
  120. 'match' => 'is_numeric',
  121. ),
  122. 'order_card_id' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '订单表id',
  126. 'default' => '',
  127. 'desc' => '订单表id',
  128. 'match' => 'is_numeric',
  129. ),
  130. 'bdate' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '绑定时间',
  134. 'match' => 'option',
  135. 'default' => '',
  136. 'desc' => '',
  137. //'search' => 'date',
  138. ),
  139. 'ddate' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '兑换时间',
  143. 'match' => 'option',
  144. 'default' => '',
  145. 'desc' => '',
  146. //'search' => 'date',
  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. 'uid' => 'uid',
  188. 'dh_uid' => 'dh_uid',
  189. ),
  190. 'version' => 1,
  191. ),
  192. 'request' => array
  193. (
  194. 'getData' => array
  195. (
  196. # 匹配的正则或函数 选填项
  197. 'option' => array
  198. (
  199. 'uid' => 'yes',
  200. 'dh_uid' => 'yes',
  201. 'card_id' => 'yes',
  202. 'status' => 'yes',
  203. 'state' => 1,
  204. ),
  205. 'type' => 'all',
  206. 'limit' => '0,10',
  207. 'order' => array('ddate' => 'desc'),
  208. 'col' => '*',
  209. ),
  210. 'getPageData' => array
  211. (
  212. # 匹配的正则或函数 选填项
  213. 'option' => array
  214. (
  215. 'uid' => 'yes',
  216. 'dh_uid' => 'yes',
  217. 'status' => 'yes',
  218. 'state' => 1,
  219. ),
  220. 'type' => 'all',
  221. 'page' => array(10, 'list'),
  222. 'order' => array('ddate' => 'desc'),
  223. 'col' => '*',
  224. ),
  225. ),
  226. );