code.php 6.0 KB

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