price_rule.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?php
  2. $goods = array
  3. (
  4. 1 => '所有商品',
  5. 2 => '部分商品',
  6. );
  7. $category = function()
  8. {
  9. $array = array();
  10. $data = Dever::load('scm_product/category-getTop');
  11. if($data)
  12. {
  13. $array += $data;
  14. }
  15. return $array;
  16. };
  17. $status = array
  18. (
  19. 1 => '有效',
  20. 2 => '失效',
  21. );
  22. $type = array
  23. (
  24. 1 => '统一调价',
  25. 2 => '手动改价',
  26. );
  27. $time = array
  28. (
  29. 1 => '长期有效',
  30. 2 => '短期有效',
  31. );
  32. return array
  33. (
  34. # 表名
  35. 'name' => 'price_rule',
  36. # 显示给用户看的名称
  37. 'lang' => '价格模板策略',
  38. # 是否显示在后台菜单
  39. 'order' => 9,
  40. 'menu' => false,
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. //'list' => true,
  52. 'order' => 'asc',
  53. ),
  54. 'price_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '所属价格模板',
  58. 'default' => '',
  59. 'desc' => '所属价格模板',
  60. 'match' => 'is_numeric',
  61. 'update' => 'hidden',
  62. 'search' => 'hidden',
  63. 'value' => Dever::input('search_option_price_id'),
  64. 'list' => 'Dever::load("scm_product/price-one#name", {price_id})',
  65. ),
  66. 'name' => array
  67. (
  68. 'type' => 'varchar-150',
  69. 'name' => '策略名称',
  70. 'default' => '',
  71. 'desc' => '策略名称',
  72. 'match' => 'is_string',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. 'edit' => true,
  77. ),
  78. 'category' => array
  79. (
  80. 'type' => 'varchar-2000',
  81. 'name' => '影响分类-如不选择就是影响所有商品',
  82. 'default' => '',
  83. 'desc' => '模板影响分类',
  84. 'match' => 'is_string',
  85. 'update' => 'checkbox',
  86. 'option' => $category,
  87. ),
  88. 'type' => array
  89. (
  90. 'type' => 'tinyint-1',
  91. 'name' => '调价规则-手动调价需要在配置商品中进行手动调整',
  92. 'default' => '1',
  93. 'desc' => '调价规则',
  94. 'match' => 'is_numeric',
  95. 'update' => 'radio',
  96. 'option' => $type,
  97. 'list' => true,
  98. 'control' => 'type',
  99. ),
  100. 'sell_num' => array
  101. (
  102. 'type' => 'varchar-30',
  103. 'name' => '销售调价数值-直接输入数字就是统一调价的增减数值,负数就是减少,如果是百分比,就带上%号即可,如10%,模板下的商品将统一进行加价或者减价',
  104. 'default' => '',
  105. 'desc' => '销售调价数值',
  106. 'match' => 'is_string',
  107. 'update' => 'text',
  108. 'show' => 'type=1',
  109. ),
  110. 'buy_num' => array
  111. (
  112. 'type' => 'varchar-30',
  113. 'name' => '采购调价数值-直接输入数字就是统一调价的增减数值,负数就是减少,如果是百分比,就带上%号即可,如10%,模板下的商品将统一进行加价或者减价',
  114. 'default' => '',
  115. 'desc' => '采购调价数值',
  116. 'match' => 'is_string',
  117. 'update' => 'text',
  118. 'show' => 'type=1',
  119. ),
  120. 'day' => array
  121. (
  122. 'type' => 'varchar-30',
  123. 'name' => '临期天数-填写该天数,如果商品有保质期,在小于等于该天数的时间内,将是不同的价格,为0则不验证保质期',
  124. 'default' => '0',
  125. 'desc' => '临期天数',
  126. 'match' => 'is_string',
  127. 'update' => 'text',
  128. ),
  129. 'time' => array
  130. (
  131. 'type' => 'tinyint-1',
  132. 'name' => '模板有效期',
  133. 'default' => '1',
  134. 'desc' => '模板有效期',
  135. 'match' => 'is_numeric',
  136. 'update' => 'radio',
  137. 'option' => $time,
  138. 'list' => true,
  139. 'control' => 'time',
  140. ),
  141. 'time_start' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '开始时间',
  145. 'default' => '',
  146. 'match' => 'is_numeric',
  147. 'desc' => '开始时间',
  148. 'update' => 'date',
  149. 'show' => 'time=2',
  150. ),
  151. 'time_end' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '结束时间',
  155. 'default' => '',
  156. 'match' => 'is_numeric',
  157. 'desc' => '结束时间',
  158. 'update' => 'date',
  159. 'show' => 'time=2',
  160. ),
  161. 'status' => array
  162. (
  163. 'type' => 'tinyint-1',
  164. 'name' => '是否有效',
  165. 'default' => '1',
  166. 'desc' => '是否有效',
  167. 'match' => 'is_numeric',
  168. //'update' => 'radio',
  169. 'option' => $status,
  170. 'list' => true,
  171. 'edit' => true,
  172. ),
  173. 'reorder' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '优先级-数值越大优先级越高',
  177. 'default' => '1',
  178. 'desc' => '优先级排序',
  179. 'match' => 'option',
  180. 'update' => 'text',
  181. 'search' => 'order',
  182. 'list' => true,
  183. 'order' => 'desc',
  184. 'edit' => true,
  185. ),
  186. 'state' => array
  187. (
  188. 'type' => 'tinyint-1',
  189. 'name' => '状态',
  190. 'default' => '1',
  191. 'desc' => '请选择状态',
  192. 'match' => 'is_numeric',
  193. ),
  194. 'cdate' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '录入时间',
  198. 'match' => array('is_numeric', time()),
  199. 'desc' => '',
  200. # 只有insert时才生效
  201. 'insert' => true,
  202. //'search' => 'date',
  203. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  204. ),
  205. ),
  206. 'manage' => array
  207. (
  208. //'insert' => false,
  209. //'edit' => false,
  210. # 自定义快捷新增和编辑
  211. 'button' => array
  212. (
  213. //'新增' => array('fast'),
  214. ),
  215. 'list_button' => array
  216. (
  217. //'edit' => array('编辑'),
  218. 'location' => array('配置商品', Dever::url('lib/price.setGoods', 'scm_product')),
  219. )
  220. ),
  221. 'request' => array
  222. (
  223. )
  224. );