info.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. return array
  16. (
  17. # 表名
  18. 'name' => 'info',
  19. # 显示给用户看的名称
  20. 'lang' => '面值配置',
  21. # 后台菜单排序
  22. 'order' => 99,
  23. # 数据结构
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. 'search' => 'order',
  34. 'list' => true,
  35. 'order' => 'desc',
  36. ),
  37. 'name' => array
  38. (
  39. 'type' => 'varchar-80',
  40. 'name' => '礼品卡名称',
  41. 'default' => '',
  42. 'desc' => '请输入礼品卡名称',
  43. 'match' => 'is_string',
  44. 'update' => 'text',
  45. 'search' => 'fulltext',
  46. 'list' => true,
  47. ),
  48. 'type_id' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '礼品卡类型',
  52. 'default' => '1',
  53. 'desc' => '礼品卡类型',
  54. 'match' => 'is_numeric',
  55. 'update' => 'radio',
  56. 'option' => $type,
  57. 'list' => true,
  58. ),
  59. 'value' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '面值',
  63. 'default' => '100',
  64. 'desc' => '面值',
  65. 'match' => 'is_numeric',
  66. 'update' => 'text',
  67. 'list' => true,
  68. ),
  69. 'price' => array
  70. (
  71. 'type' => 'varchar-80',
  72. 'name' => '售价',
  73. 'default' => '100',
  74. 'desc' => '售价',
  75. 'match' => 'is_numeric',
  76. 'update' => 'text',
  77. 'list' => true,
  78. ),
  79. 'card_type' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '卡号生成规则',
  83. 'default' => '3',
  84. 'desc' => '卡号生成规则',
  85. 'match' => 'is_numeric',
  86. 'update' => 'select',
  87. 'option' => $card_type,
  88. 'list_name' => '数量',
  89. 'list' => 'Dever::load("card/lib/manage.getNum", "{id}")',
  90. ),
  91. 'card_prefix' => array
  92. (
  93. 'type' => 'varchar-80',
  94. 'name' => '卡号前缀-前缀不占用卡号长度的位数,如卡号长度填写14,卡号前缀为Q,则生成卡号前缀+14位随机数',
  95. 'default' => '',
  96. 'desc' => '卡号前缀',
  97. 'match' => 'option',
  98. 'update' => 'text',
  99. ),
  100. 'card_len' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '卡号长度',
  104. 'default' => '14',
  105. 'desc' => '卡号长度',
  106. 'match' => 'is_numeric',
  107. 'update' => 'text',
  108. ),
  109. 'status' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '状态',
  113. 'default' => '1',
  114. 'desc' => '状态',
  115. 'match' => 'is_numeric',
  116. //'update' => 'select',
  117. 'option' => $status,
  118. 'search' => 'select',
  119. 'list' => true,
  120. 'edit' => true,
  121. ),
  122. 'reorder' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '排序-数值越大越靠前',
  126. 'default' => '1',
  127. 'desc' => '请输入排序',
  128. 'match' => 'option',
  129. 'update' => 'text',
  130. 'search' => 'order',
  131. 'list' => true,
  132. 'order' => 'desc',
  133. 'edit' => true,
  134. ),
  135. 'state' => array
  136. (
  137. 'type' => 'tinyint-1',
  138. 'name' => '状态',
  139. 'default' => '1',
  140. 'desc' => '请选择状态',
  141. 'match' => 'is_numeric',
  142. ),
  143. 'cdate' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '录入时间',
  147. 'match' => array('is_numeric', time()),
  148. 'desc' => '',
  149. # 只有insert时才生效
  150. 'insert' => true,
  151. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  152. ),
  153. ),
  154. 'manage' => array
  155. (
  156. 'list_button' => array
  157. (
  158. 'fast' => array('生成卡号', '"add&where_id=1&search_option_card_id={id}"', '{status} == 1'),
  159. 'list1' => array('卡号列表', '"code&search_option_card_id={id}&oper_table=info"'),
  160. ),
  161. ),
  162. 'request' => array
  163. (
  164. ),
  165. );