card.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $method = array
  4. (
  5. 1 => '自提',
  6. 2 => '配送',
  7. 3 => '自提+配送',
  8. );
  9. $type = array
  10. (
  11. 1 => '永久有效',
  12. 2 => '固定天数',
  13. );
  14. $card_type = array
  15. (
  16. 1 => '全数字',
  17. 2 => '全小写',
  18. 3 => '全大写',
  19. 4 => '大小写组合',
  20. 5 => '数字+大小写组合',
  21. );
  22. return array
  23. (
  24. # 表名
  25. 'name' => 'card',
  26. # 显示给用户看的名称
  27. 'lang' => '礼品卡配置',
  28. # 后台菜单排序
  29. 'order' => 99,
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. 'search' => 'order',
  41. 'list' => true,
  42. 'order' => 'desc',
  43. ),
  44. 'name' => array
  45. (
  46. 'type' => 'varchar-80',
  47. 'name' => '礼品卡名称',
  48. 'default' => '',
  49. 'desc' => '请输入礼品卡名称',
  50. 'match' => 'is_string',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'type' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '礼品卡类型-永久有效的时间为10年,即3650天',
  59. 'default' => '1',
  60. 'desc' => '礼品卡类型',
  61. 'match' => 'is_numeric',
  62. 'update' => 'radio',
  63. 'option' => $type,
  64. 'control' => 'type',
  65. ),
  66. 'day' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '有效天数',
  70. 'default' => '7',
  71. 'desc' => '有效天数',
  72. 'match' => 'is_numeric',
  73. 'update' => 'text',
  74. 'show' => 'type=2',
  75. ),
  76. 'card_type' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '卡号生成规则',
  80. 'default' => '3',
  81. 'desc' => '卡号生成规则',
  82. 'match' => 'is_numeric',
  83. 'update' => 'select',
  84. 'option' => $card_type,
  85. ),
  86. 'card_prefix' => array
  87. (
  88. 'type' => 'varchar-80',
  89. 'name' => '卡号前缀-前缀不占用卡号长度的位数,如卡号长度填写14,卡号前缀为Q,则生成卡号前缀+14位随机数',
  90. 'default' => '',
  91. 'desc' => '卡号前缀',
  92. 'match' => 'option',
  93. 'update' => 'text',
  94. ),
  95. 'card_len' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '卡号长度',
  99. 'default' => '14',
  100. 'desc' => '卡号长度',
  101. 'match' => 'is_numeric',
  102. 'update' => 'text',
  103. ),
  104. 'pwd_type' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '密码生成规则',
  108. 'default' => '3',
  109. 'desc' => '密码生成规则',
  110. 'match' => 'is_numeric',
  111. 'update' => 'select',
  112. 'option' => $card_type,
  113. ),
  114. 'pwd_prefix' => array
  115. (
  116. 'type' => 'varchar-80',
  117. 'name' => '密码前缀',
  118. 'default' => '',
  119. 'desc' => '密码前缀',
  120. 'match' => 'option',
  121. 'update' => 'text',
  122. ),
  123. 'pwd_len' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '密码长度',
  127. 'default' => '8',
  128. 'desc' => '密码长度',
  129. 'match' => 'is_numeric',
  130. 'update' => 'text',
  131. ),
  132. 'method' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '领取方式',
  136. 'default' => '3',
  137. 'desc' => '领取方式',
  138. 'match' => 'is_numeric',
  139. //'update' => 'radio',
  140. 'option' => $method,
  141. //'control' => 'method',
  142. ),
  143. 'goods' => array
  144. (
  145. 'type' => 'text-1000',
  146. 'name' => '商品配置-如果该商品有多种价格,礼品卡只能兑换最低价格的商品',
  147. 'default' => '',
  148. 'desc' => '商品配置',
  149. 'match' => 'is_string',
  150. 'update' => array
  151. (
  152. array
  153. (
  154. 'col' => 'goods_id',
  155. 'name' => '选择商品',
  156. 'default' => '',
  157. 'desc' => '选择商品',
  158. 'match' => 'option',
  159. 'update' => 'select',
  160. 'update_search' => 'goods/lib/manage.search',
  161. ),
  162. array
  163. (
  164. 'col' => 'num',
  165. 'name' => '数量',
  166. 'default' => '1',
  167. 'desc' => '数量',
  168. 'match' => 'is_string',
  169. 'update' => 'text',
  170. ),
  171. ),
  172. ),
  173. 'status' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '状态',
  177. 'default' => '1',
  178. 'desc' => '状态',
  179. 'match' => 'is_numeric',
  180. //'update' => 'select',
  181. 'option' => $status,
  182. 'search' => 'select',
  183. 'list' => true,
  184. 'edit' => true,
  185. ),
  186. 'state' => array
  187. (
  188. 'type' => 'tinyint-1',
  189. 'name' => '状态',
  190. 'default' => '1',
  191. 'desc' => '请选择状态',
  192. 'match' => 'is_numeric',
  193. ),
  194. 'cdate' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '录入时间',
  198. 'match' => array('is_numeric', time()),
  199. 'desc' => '',
  200. # 只有insert时才生效
  201. 'insert' => true,
  202. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  203. ),
  204. ),
  205. 'manage' => array
  206. (
  207. 'list_button' => array
  208. (
  209. 'fast' => array('生成卡密', '"add_card&where_id=1&search_option_card_id={id}"', '{status} == 1'),
  210. 'list1' => array('卡密列表', '"card_code&search_option_card_id={id}&oper_table=card"'),
  211. ),
  212. ),
  213. 'request' => array
  214. (
  215. ),
  216. );