goods.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. $status = Dever::config('base')->status;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'goods',
  7. # 显示给用户看的名称
  8. 'lang' => '经销商商品列表',
  9. 'order' => 10,
  10. 'menu' => false,
  11. /*
  12. 'end' => array
  13. (
  14. 'insert' => 'scm_role/lib/seller.goodsUpdate',
  15. 'update' => 'scm_role/lib/seller.goodsUpdate',
  16. ),
  17. */
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. 'update' => 'hidden',
  30. //'list' => true,
  31. ),
  32. 'seller_id' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '所属经销商',
  36. 'default' => '',
  37. 'desc' => '所属经销商',
  38. 'match' => 'is_numeric',
  39. 'update' => 'hidden',
  40. 'search' => 'hidden',
  41. 'value' => Dever::input('search_option_seller_id'),
  42. 'list' => 'Dever::load("scm_seller/info-one#name", {seller_id})',
  43. ),
  44. 'goods_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '商品名称',
  48. 'default' => '',
  49. 'desc' => '商品名称',
  50. 'match' => 'is_numeric',
  51. 'update' => 'select',
  52. 'update_search' => 'scm_product/lib/manage.search',
  53. 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
  54. ),
  55. 'sku_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '规格型号',
  59. 'default' => '-1',
  60. 'desc' => '规格型号',
  61. 'match' => 'is_numeric',
  62. ),
  63. 'sell_min' => array
  64. (
  65. 'type' => 'decimal-11,2',
  66. 'name' => '销售起订数',
  67. 'default' => '1',
  68. 'desc' => '销售起订数',
  69. 'match' => 'is_numeric',
  70. 'update' => 'text',
  71. //'list' => true,
  72. ),
  73. 'buy_min' => array
  74. (
  75. 'type' => 'decimal-11,2',
  76. 'name' => '采购起订数',
  77. 'default' => '1',
  78. 'desc' => '采购起订数',
  79. 'match' => 'is_numeric',
  80. 'update' => 'text',
  81. //'list' => true,
  82. ),
  83. 'state' => array
  84. (
  85. 'type' => 'tinyint-1',
  86. 'name' => '状态',
  87. 'default' => '1',
  88. 'desc' => '请选择状态',
  89. 'match' => 'is_numeric',
  90. ),
  91. 'cdate' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '创建时间',
  95. 'match' => array('is_numeric', time()),
  96. 'desc' => '',
  97. # 只有insert时才生效
  98. //'insert' => true,
  99. //'search' => 'date',
  100. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  101. ),
  102. ),
  103. 'manage' => array
  104. (
  105. 'insert' => false,
  106. 'edit' => false,
  107. 'delete' => false,
  108. ),
  109. 'request' => array
  110. (
  111. # 后台搜索用到,也可以不加,自动生成
  112. 'search' => array
  113. (
  114. # 匹配的正则或函数 选填项
  115. 'option' => array
  116. (
  117. 'seller_id' => array('yes-t_1.seller_id'),
  118. 'status' => 'yes-t_2.status-1',
  119. 'state' => 'yes-t_2.state-1',
  120. 'state_1' => 'yes-t_1.state-1',
  121. ),
  122. # 联表
  123. 'join' => array
  124. (
  125. array
  126. (
  127. 'table' => 'scm_product/info',
  128. 'type' => 'left join',
  129. 'on' => array('goods_id','id'),
  130. 'col' => 'goods_id',
  131. ),
  132. ),
  133. 'type' => 'all',
  134. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  135. 'col' => '*,t_2.*,t_2.id as value, "" as selected, "" as disabled',
  136. ),
  137. 'getData' => array
  138. (
  139. # 匹配的正则或函数 选填项
  140. 'option' => array
  141. (
  142. 'seller_id' => array('yes-t_1.seller_id'),
  143. 'name' => array('yes-t_2.name', 'like'),
  144. 'category' => array('yes-t_2.category', 'like'),
  145. 'top_category_id' => array('yes-t_2.top_category_id'),
  146. 'second_category_id' => array('yes-t_2.second_category_id'),
  147. 'category_id' => array('yes-t_2.category_id'),
  148. 'status' => 'yes-t_2.status-1',
  149. 'state' => 'yes-t_2.state-1',
  150. 'state_1' => 'yes-t_1.state-1',
  151. ),
  152. # 联表
  153. 'join' => array
  154. (
  155. array
  156. (
  157. 'table' => 'scm_product/info',
  158. 'type' => 'left join',
  159. 'on' => array('goods_id','id'),
  160. 'col' => 'goods_id',
  161. ),
  162. ),
  163. 'type' => 'all',
  164. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  165. 'col' => '*,t_2.*',
  166. ),
  167. 'getDataPage' => array
  168. (
  169. # 匹配的正则或函数 选填项
  170. 'option' => array
  171. (
  172. 'seller_id' => array('yes-t_1.seller_id'),
  173. 'name' => array('yes-t_2.name', 'like'),
  174. 'category' => array('yes-t_2.category', 'like'),
  175. 'top_category_id' => array('yes-t_2.top_category_id'),
  176. 'second_category_id' => array('yes-t_2.second_category_id'),
  177. 'category_id' => array('yes-t_2.category_id'),
  178. 'status' => 'yes-t_2.status-1',
  179. 'state' => 'yes-t_2.state-1',
  180. 'state_1' => 'yes-t_1.state-1',
  181. ),
  182. # 联表
  183. 'join' => array
  184. (
  185. array
  186. (
  187. 'table' => 'scm_product/info',
  188. 'type' => 'left join',
  189. 'on' => array('goods_id','id'),
  190. 'col' => 'goods_id',
  191. ),
  192. ),
  193. 'type' => 'all',
  194. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  195. 'page' => array(10, 'list'),
  196. 'col' => '*,t_2.*',
  197. ),
  198. 'getOne' => array
  199. (
  200. # 匹配的正则或函数 选填项
  201. 'option' => array
  202. (
  203. 'seller_id' => 'yes',
  204. 'goods_id' => 'yes',
  205. 'sku_id' => 'yes',
  206. 'state' => 1,
  207. ),
  208. 'type' => 'one',
  209. 'col' => '*',
  210. ),
  211. ),
  212. );