product.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <?php
  2. # 定义几个常用的选项
  3. $status = array
  4. (
  5. 1 => '在线',
  6. 2 => '下线',
  7. );
  8. $type = array
  9. (
  10. 1 => '购买',
  11. 2 => '兑换',
  12. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'product',
  17. # 显示给用户看的名称
  18. 'lang' => '产品管理',
  19. 'order' => 100,
  20. 'menu' => 'main',
  21. 'end' => array
  22. (
  23. 'update' => 'code/lib/manage.create',
  24. 'insert' => 'code/lib/manage.create',
  25. ),
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. //'list' => true,
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-80',
  42. 'name' => '产品名称',
  43. 'default' => '',
  44. 'desc' => '产品名称',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'fulltext',
  48. 'list' => true,
  49. ),
  50. 'pic' => array
  51. (
  52. 'type' => 'text-255',
  53. 'name' => '产品图片-可多张,点击图片可删除,图片大小:750px*390px',
  54. 'default' => '',
  55. 'desc' => '请选择图片',
  56. 'match' => 'is_string',
  57. 'update' => 'images',
  58. 'key' => '1',
  59. 'place' => '150',
  60. ),
  61. 'info' => array
  62. (
  63. 'type' => 'varchar-800',
  64. 'name' => '产品介绍',
  65. 'default' => '',
  66. 'desc' => '产品介绍',
  67. 'match' => 'is_string',
  68. 'update' => 'textarea',
  69. ),
  70. 'edate' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '产品有效期-直接填写天数即可,统一的有效期请到基本设置中配置,如果该产品与统一有效期不一致,可在此填写',
  74. 'default' => '',
  75. 'match' => 'option',
  76. 'desc' => '产品有效期',
  77. //'update' => 'text',
  78. ),
  79. 'pay_button_text' => array
  80. (
  81. 'type' => 'varchar-200',
  82. 'name' => '付款按钮文字-首页的付款按钮文字描述',
  83. 'default' => '',
  84. 'desc' => '付款按钮文字',
  85. 'match' => 'option',
  86. 'update' => 'textarea',
  87. ),
  88. 'cover_pic' => array
  89. (
  90. 'type' => 'varchar-150',
  91. 'name' => '产品封面图-尺寸:632px*400px',
  92. 'default' => '',
  93. 'desc' => '产品封面图',
  94. 'match' => 'option',
  95. 'update' => 'images',
  96. 'key' => '1',
  97. 'place' => '150',
  98. ),
  99. 'link' => array
  100. (
  101. 'type' => 'varchar-500',
  102. 'name' => '产品购买路径-如果是小程序,请填写路径,如果是h5,直接填写链接',
  103. 'default' => '',
  104. 'desc' => '产品购买路径',
  105. 'match' => 'option',
  106. 'update' => 'text',
  107. ),
  108. 'price' => array
  109. (
  110. 'type' => 'varchar-50',
  111. 'name' => '产品销售价格',
  112. 'default' => '',
  113. 'desc' => '产品销售价格',
  114. 'match' => 'is_string',
  115. 'update' => 'text',
  116. ),
  117. 'oprice' => array
  118. (
  119. 'type' => 'varchar-50',
  120. 'name' => '产品原价',
  121. 'default' => '',
  122. 'desc' => '产品原价',
  123. 'match' => 'is_string',
  124. 'update' => 'text',
  125. ),
  126. 'price_info' => array
  127. (
  128. 'type' => 'varchar-500',
  129. 'name' => '购买文字提示',
  130. 'default' => '',
  131. 'desc' => '购买文字提示',
  132. 'match' => 'is_string',
  133. 'update' => 'textarea',
  134. ),
  135. 'content' => array
  136. (
  137. 'type' => 'longtext',
  138. 'name' => '产品内容',
  139. 'default' => '',
  140. 'desc' => '产品内容',
  141. 'match' => 'is_string',
  142. 'update' => 'editor',
  143. ),
  144. 'type' => array
  145. (
  146. 'type' => 'varchar-150',
  147. 'name' => '获取方式',
  148. 'default' => '1',
  149. 'desc' => '获取方式',
  150. 'match' => 'is_numeric',
  151. 'option' => $type,
  152. 'search' => 'select',
  153. 'update' => 'checkbox',
  154. 'list' => true,
  155. 'control' => 'type',
  156. ),
  157. 'cash' => array
  158. (
  159. 'type' => 'varchar-50',
  160. 'name' => '支付价格-单位元,直接填写数字即可',
  161. 'default' => '',
  162. 'desc' => '支付价格',
  163. 'match' => 'is_string',
  164. 'update' => 'text',
  165. 'show' => 'type=1',
  166. ),
  167. 'unit' => array
  168. (
  169. 'type' => 'varchar-50',
  170. 'name' => '支付价格的单位-如人民币:元',
  171. 'default' => '',
  172. 'desc' => '支付价格的单位',
  173. 'match' => 'option',
  174. 'update' => 'text',
  175. 'show' => 'type=1',
  176. ),
  177. 'code' => array
  178. (
  179. 'type' => 'varchar-50',
  180. 'name' => '兑换码数量-直接填写数字即可,系统将自动生成对应数量的兑换码',
  181. 'default' => '',
  182. 'desc' => '兑换码数量',
  183. 'match' => 'is_string',
  184. 'update' => 'text',
  185. 'show' => 'type=2',
  186. ),
  187. 'status' => array
  188. (
  189. 'type' => 'tinyint-1',
  190. 'name' => '在线状态',
  191. 'default' => '1',
  192. 'desc' => '请选择在线状态',
  193. 'match' => 'is_numeric',
  194. 'option' => $status,
  195. 'search' => 'select',
  196. 'update' => 'radio',
  197. 'list' => true,
  198. 'edit' => true,
  199. ),
  200. 'question_name' => array
  201. (
  202. 'type' => 'varchar-80',
  203. 'name' => '问卷标题-如果为空,则自动读取产品标题',
  204. 'default' => '',
  205. 'desc' => '问卷标题',
  206. 'match' => 'option',
  207. //'update' => 'text',
  208. ),
  209. 'question_pic' => array
  210. (
  211. 'type' => 'varchar-150',
  212. 'name' => '问卷封面',
  213. 'default' => '',
  214. 'desc' => '问卷封面',
  215. 'match' => 'is_string',
  216. //'update' => 'image',
  217. //'key' => '1',
  218. ),
  219. 'question_desc' => array
  220. (
  221. 'type' => 'text-255',
  222. 'name' => '问卷温馨提示',
  223. 'default' => '',
  224. 'desc' => '问卷温馨提示',
  225. 'match' => 'option',
  226. //'update' => 'textarea',
  227. ),
  228. 'question_content' => array
  229. (
  230. 'type' => 'text-255',
  231. 'name' => '问卷介绍',
  232. 'default' => '',
  233. 'desc' => '问卷介绍',
  234. 'match' => 'option',
  235. 'update' => 'editor',
  236. ),
  237. 'reorder' => array
  238. (
  239. 'type' => 'int-11',
  240. 'name' => '排序(数值越大越靠前)',
  241. 'default' => '1',
  242. 'desc' => '请输入排序',
  243. 'match' => 'option',
  244. 'update' => 'text',
  245. 'search' => 'order',
  246. 'list_name' => '排序',
  247. 'list' => true,
  248. 'order' => 'desc',
  249. 'edit' => true,
  250. ),
  251. 'state' => array
  252. (
  253. 'type' => 'tinyint-1',
  254. 'name' => '状态',
  255. 'default' => '1',
  256. 'desc' => '请选择状态',
  257. 'match' => 'is_numeric',
  258. ),
  259. 'cdate' => array
  260. (
  261. 'type' => 'int-11',
  262. 'name' => '申请时间',
  263. 'match' => array('is_numeric', time()),
  264. 'desc' => '',
  265. # 只有insert时才生效
  266. 'insert' => true,
  267. 'search' => 'date',
  268. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  269. ),
  270. ),
  271. 'manage' => array
  272. (
  273. 'list_button' => array
  274. (
  275. 'list1' => array('兑换码列表', '"info&project=code&search_option_product_id={id}&oper_parent=product&oper_project=service"'),
  276. //'list1' => array('规格管理', '"product_price&project=service&search_option_product_id={id}&oper_parent=product&oper_project=service"'),
  277. 'list' => array('问卷管理', '"info&project=survey&search_option_product_id={id}&oper_parent=product&oper_project=service"'),
  278. ),
  279. ),
  280. 'request' => array
  281. (
  282. 'getAll' => array
  283. (
  284. # 匹配的正则或函数 选填项
  285. 'option' => array
  286. (
  287. 'status' => 1,
  288. 'state' => 1,
  289. ),
  290. 'type' => 'all',
  291. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  292. 'page' => array(10, 'list'),
  293. 'col' => '*',
  294. ),
  295. ),
  296. );