info.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $type = function()
  4. {
  5. return Dever::db('card/type')->state();
  6. };
  7. $card_type = array
  8. (
  9. 1 => '全数字',
  10. 2 => '全小写',
  11. 3 => '全大写',
  12. 4 => '大小写组合',
  13. 5 => '数字+大小写组合',
  14. );
  15. $create_type = array
  16. (
  17. 1 => '正常礼品卡',
  18. 2 => '合并礼品卡',
  19. );
  20. return array
  21. (
  22. # 表名
  23. 'name' => 'info',
  24. # 显示给用户看的名称
  25. 'lang' => '面值配置',
  26. # 后台菜单排序
  27. 'order' => 99,
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => 'ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. 'search' => 'order',
  39. 'list' => true,
  40. 'order' => 'desc',
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-80',
  45. 'name' => '礼品卡名称',
  46. 'default' => '',
  47. 'desc' => '请输入礼品卡名称',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'type_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '礼品卡类型',
  57. 'default' => '1',
  58. 'desc' => '礼品卡类型',
  59. 'match' => 'is_numeric',
  60. 'update' => 'radio',
  61. 'option' => $type,
  62. 'list' => true,
  63. ),
  64. 'value' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '面值',
  68. 'default' => '100',
  69. 'desc' => '面值',
  70. 'match' => 'is_numeric',
  71. 'update' => 'text',
  72. 'list' => true,
  73. ),
  74. 'price' => array
  75. (
  76. 'type' => 'varchar-80',
  77. 'name' => '售价',
  78. 'default' => '100',
  79. 'desc' => '售价',
  80. 'match' => 'is_numeric',
  81. 'update' => 'text',
  82. 'list' => true,
  83. ),
  84. 'create_type' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '生成类型',
  88. 'default' => '1',
  89. 'desc' => '生成类型',
  90. 'match' => 'is_numeric',
  91. 'update' => 'radio',
  92. 'option' => $create_type,
  93. 'list' => true,
  94. ),
  95. 'card_type' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '卡号生成规则',
  99. 'default' => '3',
  100. 'desc' => '卡号生成规则',
  101. 'match' => 'is_numeric',
  102. 'update' => 'select',
  103. 'option' => $card_type,
  104. 'list_name' => '数量',
  105. 'list' => 'Dever::load("card/lib/manage.getNum", "{id}")',
  106. ),
  107. 'card_prefix' => array
  108. (
  109. 'type' => 'varchar-80',
  110. 'name' => '卡号前缀-前缀不占用卡号长度的位数,如卡号长度填写14,卡号前缀为Q,则生成卡号前缀+14位随机数',
  111. 'default' => '',
  112. 'desc' => '卡号前缀',
  113. 'match' => 'option',
  114. 'update' => 'text',
  115. ),
  116. 'card_len' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '卡号长度',
  120. 'default' => '14',
  121. 'desc' => '卡号长度',
  122. 'match' => 'is_numeric',
  123. 'update' => 'text',
  124. ),
  125. 'status' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '状态',
  129. 'default' => '1',
  130. 'desc' => '状态',
  131. 'match' => 'is_numeric',
  132. //'update' => 'select',
  133. 'option' => $status,
  134. 'search' => 'select',
  135. 'list' => true,
  136. 'edit' => true,
  137. ),
  138. 'content' => array
  139. (
  140. 'type' => 'text-255',
  141. 'name' => '介绍',
  142. 'default' => '',
  143. 'desc' => '请输入内容',
  144. 'match' => 'is_string',
  145. 'update' => 'editor',
  146. 'key' => '1',
  147. ),
  148. 'reorder' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '排序-数值越大越靠前',
  152. 'default' => '1',
  153. 'desc' => '请输入排序',
  154. 'match' => 'option',
  155. 'update' => 'text',
  156. 'search' => 'order',
  157. 'list' => true,
  158. 'order' => 'desc',
  159. 'edit' => true,
  160. ),
  161. 'state' => array
  162. (
  163. 'type' => 'tinyint-1',
  164. 'name' => '状态',
  165. 'default' => '1',
  166. 'desc' => '请选择状态',
  167. 'match' => 'is_numeric',
  168. ),
  169. 'cdate' => array
  170. (
  171. 'type' => 'int-11',
  172. 'name' => '录入时间',
  173. 'match' => array('is_numeric', time()),
  174. 'desc' => '',
  175. # 只有insert时才生效
  176. 'insert' => true,
  177. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  178. ),
  179. ),
  180. 'manage' => array
  181. (
  182. 'list_button' => array
  183. (
  184. 'fast' => array('生成卡号', '"add&where_id=1&search_option_card_id={id}"', '{status} == 1'),
  185. 'list1' => array('卡号列表', '"code&search_option_card_id={id}&oper_table=info"'),
  186. ),
  187. ),
  188. 'request' => array
  189. (
  190. 'getDataByType' => array
  191. (
  192. # 匹配的正则或函数 选填项
  193. 'option' => array
  194. (
  195. 'type_id' => array('yes', 'in'),
  196. 'status' => 1,
  197. 'state' => 1,
  198. ),
  199. 'type' => 'all',
  200. 'order' => array('cdate' => 'desc'),
  201. 'col' => '*',
  202. ),
  203. ),
  204. );