product_price.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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_price',
  17. # 显示给用户看的名称
  18. 'lang' => '产品规格管理',
  19. 'order' => 100,
  20. 'menu' => false,
  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. 'product_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '产品',
  43. 'default' => '',
  44. 'desc' => '产品',
  45. 'match' => 'is_numeric',
  46. 'update' => 'hidden',
  47. 'value' => Dever::input('search_option_product_id')
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-80',
  52. 'name' => '规格名称',
  53. 'default' => '',
  54. 'desc' => '规格名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'price' => array
  61. (
  62. 'type' => 'varchar-50',
  63. 'name' => '显示价格',
  64. 'default' => '',
  65. 'desc' => '显示价格',
  66. 'match' => 'is_string',
  67. 'update' => 'text',
  68. ),
  69. 'zhe_price' => array
  70. (
  71. 'type' => 'varchar-50',
  72. 'name' => '优惠价格',
  73. 'default' => '',
  74. 'desc' => '优惠价格',
  75. 'match' => 'is_string',
  76. 'update' => 'text',
  77. ),
  78. 'type' => array
  79. (
  80. 'type' => 'varchar-150',
  81. 'name' => '获取方式',
  82. 'default' => '1',
  83. 'desc' => '获取方式',
  84. 'match' => 'is_numeric',
  85. 'option' => $type,
  86. 'search' => 'select',
  87. 'update' => 'checkbox',
  88. 'list' => true,
  89. 'control' => 'type',
  90. ),
  91. 'cash' => array
  92. (
  93. 'type' => 'varchar-50',
  94. 'name' => '支付价格-单位元,直接填写数字即可',
  95. 'default' => '',
  96. 'desc' => '支付价格',
  97. 'match' => 'is_string',
  98. 'update' => 'text',
  99. 'show' => 'type=1',
  100. ),
  101. 'code' => array
  102. (
  103. 'type' => 'varchar-50',
  104. 'name' => '兑换码数量-直接填写数字即可,系统将自动生成对应数量的兑换码',
  105. 'default' => '',
  106. 'desc' => '兑换码数量',
  107. 'match' => 'is_string',
  108. 'update' => 'text',
  109. 'show' => 'type=2',
  110. ),
  111. 'reorder' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '排序(数值越大越靠前)',
  115. 'default' => '1',
  116. 'desc' => '请输入排序',
  117. 'match' => 'option',
  118. 'update' => 'text',
  119. 'search' => 'order',
  120. 'list_name' => '排序',
  121. 'list' => true,
  122. 'order' => 'desc',
  123. 'edit' => true,
  124. ),
  125. 'state' => array
  126. (
  127. 'type' => 'tinyint-1',
  128. 'name' => '状态',
  129. 'default' => '1',
  130. 'desc' => '请选择状态',
  131. 'match' => 'is_numeric',
  132. ),
  133. 'cdate' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '添加时间',
  137. 'match' => array('is_numeric', time()),
  138. 'desc' => '',
  139. # 只有insert时才生效
  140. 'insert' => true,
  141. 'search' => 'date',
  142. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  143. ),
  144. ),
  145. 'manage' => array
  146. (
  147. 'list_button' => array
  148. (
  149. 'list' => array('兑换码列表', '"info&project=code&search_option_product_id={product_id}&search_option_product_price_id={id}&oper_parent=product_price&oper_project=service"'),
  150. ),
  151. ),
  152. 'request' => array
  153. (
  154. 'getAll' => array
  155. (
  156. # 匹配的正则或函数 选填项
  157. 'option' => array
  158. (
  159. 'project_id' => 'yes',
  160. 'state' => 1,
  161. ),
  162. 'type' => 'all',
  163. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  164. 'col' => '*',
  165. ),
  166. # 最低价格的
  167. 'getDataByMin' => array
  168. (
  169. # 匹配的正则或函数 选填项
  170. 'option' => array
  171. (
  172. 'project_id' => 'yes',
  173. 'state' => 1,
  174. ),
  175. 'type' => 'one',
  176. 'order' => array('zhe_price' => 'asc','reorder' => 'desc', 'cdate' => 'desc'),
  177. 'col' => '*',
  178. ),
  179. ),
  180. );