type.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <?php
  2. $type = array
  3. (
  4. 1 => '平台购买',
  5. 2 => '门店购买',
  6. );
  7. $shop_type = Dever::db('shop/info')->config['config_type'];
  8. $city_type = array
  9. (
  10. 1 => '全国可用',
  11. 2 => '所选城市可用',
  12. );
  13. $city = function() {
  14. return Dever::load('shop/lib/info')->getCity();
  15. };
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'type',
  20. # 显示给用户看的名称
  21. 'lang' => '类型配置',
  22. # 后台菜单排序
  23. 'order' => -1,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'list' => true,
  36. 'order' => 'desc',
  37. ),
  38. 'name' => array
  39. (
  40. 'type' => 'varchar-200',
  41. 'name' => '类型名称',
  42. 'default' => '',
  43. 'desc' => '类型名称',
  44. 'match' => 'is_string',
  45. 'update' => 'text',
  46. 'search' => 'fulltext',
  47. 'list' => true,
  48. ),
  49. 'desc' => array
  50. (
  51. 'type' => 'varchar-800',
  52. 'name' => '类型描述',
  53. 'default' => '',
  54. 'desc' => '类型描述',
  55. 'match' => 'is_string',
  56. 'update' => 'textarea',
  57. ),
  58. 'type' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '购买方式',
  62. 'default' => '1',
  63. 'desc' => '购买方式',
  64. 'match' => 'is_numeric',
  65. 'update' => 'select',
  66. 'option' => $type,
  67. 'search' => 'radio',
  68. 'list' => true,
  69. ),
  70. 'shop_type' => array
  71. (
  72. 'type' => 'varchar-200',
  73. 'name' => '可用门店类型',
  74. 'default' => '',
  75. 'desc' => '可用门店类型',
  76. 'match' => 'is_string',
  77. 'update' => 'checkbox',
  78. 'option' => $shop_type,
  79. 'list' => true,
  80. ),
  81. 'city_type' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '可用范围',
  85. 'default' => '1',
  86. 'desc' => '可用范围',
  87. 'match' => 'is_numeric',
  88. 'update' => 'radio',
  89. 'option' => $city_type,
  90. 'list' => true,
  91. 'control' => 'city_type',
  92. ),
  93. 'city' => array
  94. (
  95. 'type' => 'varchar-2000',
  96. 'name' => '选择城市',
  97. 'default' => '',
  98. 'desc' => '选择城市',
  99. 'match' => 'is_string',
  100. 'update' => 'checkbox',
  101. 'option' => $city,
  102. 'show' => 'city_type=2',
  103. ),
  104. 'cover' => array
  105. (
  106. 'type' => 'varchar-150',
  107. 'name' => '封面图',
  108. 'default' => '',
  109. 'desc' => '封面图',
  110. 'match' => 'option',
  111. 'update' => 'image',
  112. 'key' => '1',
  113. 'place' => '672*386',
  114. ),
  115. 'icon' => array
  116. (
  117. 'type' => 'varchar-150',
  118. 'name' => '图标',
  119. 'default' => '',
  120. 'desc' => '图标',
  121. 'match' => 'option',
  122. 'update' => 'image',
  123. 'key' => '1',
  124. 'place' => '150*150',
  125. ),
  126. 'bgpic' => array
  127. (
  128. 'type' => 'varchar-150',
  129. 'name' => '背景图',
  130. 'default' => '',
  131. 'desc' => '背景图',
  132. 'match' => 'option',
  133. 'update' => 'image',
  134. 'key' => '1',
  135. 'place' => '686*160',
  136. ),
  137. 'content' => array
  138. (
  139. 'type' => 'text-255',
  140. 'name' => '购买使用须知',
  141. 'default' => '',
  142. 'desc' => '购买使用须知',
  143. 'match' => 'is_string',
  144. 'update' => 'textarea',
  145. 'key' => '1',
  146. ),
  147. 'reorder' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '排序-数值越大越靠前,相当于置顶',
  151. 'default' => '1',
  152. 'desc' => '请输入排序',
  153. 'match' => 'option',
  154. //'update' => 'text',
  155. 'search' => 'order',
  156. 'list' => true,
  157. 'order' => 'desc',
  158. 'edit' => true,
  159. ),
  160. 'state' => array
  161. (
  162. 'type' => 'tinyint-1',
  163. 'name' => '状态',
  164. 'default' => '1',
  165. 'desc' => '请选择状态',
  166. 'match' => 'is_numeric',
  167. ),
  168. 'cdate' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '创建时间',
  172. 'match' => array('is_numeric', time()),
  173. 'desc' => '',
  174. # 只有insert时才生效
  175. 'insert' => true,
  176. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  177. ),
  178. ),
  179. 'default' => array
  180. (
  181. 'col' => 'id,name,type,shop_type,city_type,reorder,state,cdate',
  182. 'value' => array
  183. (
  184. '1,"通用卡", 1, "1,2,10", 1, 10, 1,' . DEVER_TIME,
  185. '2,"商超卡", 1, "2", 1, 9, 1,' . DEVER_TIME,
  186. '3,"城市卡", 1, "1,2", 2, 8, 1,' . DEVER_TIME,
  187. '4,"体验卡", 2, "1", 1, 7, 1,' . DEVER_TIME,
  188. '5,"门店卡", 2, "1,2", 1, 6, 1,' . DEVER_TIME,
  189. '6,"平台店专用卡", 2, "10", 1, 5, 1,' . DEVER_TIME,
  190. ),
  191. ),
  192. 'manage' => array
  193. (
  194. 'delete' => false,
  195. ),
  196. 'request' => array
  197. (
  198. 'getAll' => array
  199. (
  200. # 匹配的正则或函数 选填项
  201. 'option' => array
  202. (
  203. 'type' => 'yes',
  204. 'state' => 1,
  205. ),
  206. 'type' => 'all',
  207. 'col' => '*',
  208. ),
  209. ),
  210. );