info.php 7.1 KB

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