price_rule_sku.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'price_rule_sku',
  6. # 显示给用户看的名称
  7. 'lang' => '价格模板单价设置',
  8. 'order' => 200,
  9. 'menu' => false,
  10. /*
  11. 'end' => array
  12. (
  13. 'insert' => 'scm_role/lib/seller.skuUpdate',
  14. 'update' => 'scm_role/lib/seller.skuUpdate',
  15. ),
  16. */
  17. # 数据结构 不同的字段放这里
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. //'list' => true,
  28. ),
  29. 'price_rule_id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '所属价格策略',
  33. 'default' => '',
  34. 'desc' => '所属价格策略',
  35. 'match' => 'is_numeric',
  36. 'update' => 'hidden',
  37. 'search' => 'hidden',
  38. 'value' => Dever::input('search_option_price_rule_id'),
  39. 'list' => 'Dever::load("scm_product/price_rule-one#name", {price_rule_id})',
  40. ),
  41. 'goods_id' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => '商品名称',
  45. 'default' => '',
  46. 'desc' => '商品名称',
  47. 'match' => 'is_numeric',
  48. 'update' => 'select',
  49. 'update_search' => 'scm_product/lib/manage.search',
  50. 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
  51. ),
  52. 'sku_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '规格型号',
  56. 'default' => '-1',
  57. 'desc' => '规格型号',
  58. 'match' => 'is_numeric',
  59. ),
  60. 'price' => array
  61. (
  62. 'type' => 'varchar-100',
  63. 'name' => '销售价',
  64. 'default' => '',
  65. 'desc' => '销售价',
  66. 'match' => 'option',
  67. 'update' => 'text',
  68. 'list' => true,
  69. ),
  70. 'buy_price' => array
  71. (
  72. 'type' => 'varchar-100',
  73. 'name' => '采购价',
  74. 'default' => '',
  75. 'desc' => '采购价',
  76. 'match' => 'option',
  77. 'update' => 'text',
  78. 'list' => true,
  79. ),
  80. 'state' => array
  81. (
  82. 'type' => 'tinyint-1',
  83. 'name' => '数据状态',
  84. 'default' => '1',
  85. 'desc' => '请选择状态',
  86. 'match' => 'is_numeric',
  87. ),
  88. 'cdate' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '发布时间',
  92. 'match' => array('is_numeric', time()),
  93. 'desc' => '',
  94. # 只有insert时才生效
  95. 'insert' => true,
  96. //'search' => 'date',
  97. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  98. ),
  99. ),
  100. 'manage' => array
  101. (
  102. 'insert' => false,
  103. 'edit' => false,
  104. 'delete' => false,
  105. //'excel' => array(array('导出门店库存', '门店库存', '')),
  106. 'page_list_table' => 'sku',
  107. ),
  108. # request 请求接口定义
  109. 'request' => array
  110. (
  111. 'getDataPage' => array
  112. (
  113. # 匹配的正则或函数 选填项
  114. 'option' => array
  115. (
  116. 'price_id' => array('yes-t_1.price_id'),
  117. 'name' => array('yes-t_2.name', 'like'),
  118. 'category' => array('yes-t_2.category', 'like'),
  119. 'top_category_id' => array('yes-t_2.top_category_id'),
  120. 'second_category_id' => array('yes-t_2.second_category_id'),
  121. 'category_id' => array('yes-t_2.category_id'),
  122. 'status' => array('yes-t_2.status', 1),
  123. 'state' => array('yes-t_2.state', 1),
  124. 'state_1' => array('yes-t_1.state', 1),
  125. ),
  126. # 联表
  127. 'join' => array
  128. (
  129. array
  130. (
  131. 'table' => 'scm_product/info',
  132. 'type' => 'left join',
  133. 'on' => array('goods_id','id'),
  134. 'col' => 'goods_id',
  135. ),
  136. ),
  137. 'type' => 'all',
  138. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc', 't_2.price' => 'asc'),
  139. 'page' => array(30, 'list'),
  140. 'col' => '*,t_2.name,t_2.pic,t_2.video,t_2.id as id',
  141. ),
  142. 'getData' => array
  143. (
  144. # 匹配的正则或函数 选填项
  145. 'option' => array
  146. (
  147. 'price_id' => array('yes-t_1.price_id'),
  148. 'name' => array('yes-t_2.name', 'like'),
  149. 'category' => array('yes-t_2.category', 'like'),
  150. 'top_category_id' => array('yes-t_2.top_category_id'),
  151. 'second_category_id' => array('yes-t_2.second_category_id'),
  152. 'category_id' => array('yes-t_2.category_id'),
  153. 'status' => array('yes-t_2.status', 1),
  154. 'state' => array('yes-t_2.state', 1),
  155. 'state_1' => array('yes-t_1.state', 1),
  156. ),
  157. # 联表
  158. 'join' => array
  159. (
  160. array
  161. (
  162. 'table' => 'scm_product/info',
  163. 'type' => 'left join',
  164. 'on' => array('goods_id','id'),
  165. 'col' => 'goods_id',
  166. ),
  167. ),
  168. 'type' => 'all',
  169. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc', 't_2.price' => 'asc'),
  170. 'col' => '*,t_2.name,t_2.pic,t_2.video,t_2.id as id',
  171. ),
  172. ),
  173. );
  174. return $config;