card_code.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已生成',
  5. 2 => '未兑换',
  6. 3 => '已使用',
  7. 4 => '已完成',
  8. 5 => '已过期',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'card_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("goods/card-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. 'pwd' => array
  57. (
  58. 'type' => 'varchar-32',
  59. 'name' => '密码',
  60. 'default' => '',
  61. 'desc' => '密码',
  62. 'match' => 'is_string',
  63. 'update' => 'text',
  64. 'search' => 'fulltext',
  65. 'list' => true,
  66. ),
  67. 'status' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '使用状态',
  71. 'default' => '1',
  72. 'desc' => '使用状态',
  73. 'match' => 'is_numeric',
  74. 'option' => $status,
  75. 'search' => 'select',
  76. 'update' => 'select',
  77. 'list' => true,
  78. //'mul' => array(1 => '恢复使用', 4 => '已作废'),
  79. ),
  80. 'uid' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '用户信息',
  84. 'default' => '0',
  85. 'desc' => '用户信息',
  86. 'match' => 'is_numeric',
  87. 'list_name' => '兑换信息',
  88. //'list' => 'Dever::load("goods/lib/manage.showUserInfo", "{id}")',
  89. ),
  90. 'shop_id' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '兑换门店',
  94. 'default' => '',
  95. 'desc' => '兑换门店',
  96. 'match' => 'is_numeric',
  97. ),
  98. 'order_id' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '订单表id',
  102. 'default' => '',
  103. 'desc' => '订单表id',
  104. 'match' => 'is_numeric',
  105. ),
  106. 'ddate' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '兑换时间',
  110. 'match' => 'option',
  111. 'default' => '',
  112. 'desc' => '',
  113. //'search' => 'date',
  114. ),
  115. 'edate' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '失效时间',
  119. 'match' => 'is_numeric',
  120. 'default' => '',
  121. 'desc' => '',
  122. 'list' => 'date("Y-m-d H:i:s", {edate})',
  123. ),
  124. 'state' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '状态',
  128. 'default' => '1',
  129. 'desc' => '请选择状态',
  130. 'match' => 'is_numeric',
  131. ),
  132. 'cdate' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '生成时间',
  136. 'match' => array('is_numeric', time()),
  137. 'desc' => '',
  138. # 只有insert时才生效
  139. 'insert' => true,
  140. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  141. ),
  142. ),
  143. 'manage' => array
  144. (
  145. 'excel' => true,
  146. 'delete' => false,
  147. 'edit' => false,
  148. 'insert' => false,
  149. // 'mul' => '{type} == 1 || {type} == 4',
  150. 'list_button' => array
  151. (
  152. //'oper' => array('作废', 'goods/lib/manage.drop?id={id}', '{type} == 1'),
  153. //'oper2' => array('恢复使用', 'goods/lib/manage.recovery?id={id}', '{type} == 4'),
  154. ),
  155. ),
  156. # 索引
  157. 'index' => array
  158. (
  159. # 索引名 => 索引id
  160. 1 => array
  161. (
  162. 'card' => 'card,pwd'
  163. ),
  164. 'version' => 1,
  165. ),
  166. 'request' => array
  167. (
  168. ),
  169. );