goods.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. 'supplier_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_supplier_id'),
  42. 'list' => 'Dever::load("scm_supplier/info-one#name", {supplier_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. 'cost_price' => array
  64. (
  65. 'type' => 'varchar-100',
  66. 'name' => '成本价',
  67. 'default' => '',
  68. 'desc' => '成本价',
  69. 'match' => 'option',
  70. 'update' => 'text',
  71. //'list' => true,
  72. ),
  73. 'state' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '状态',
  77. 'default' => '1',
  78. 'desc' => '请选择状态',
  79. 'match' => 'is_numeric',
  80. ),
  81. 'cdate' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '创建时间',
  85. 'match' => array('is_numeric', time()),
  86. 'desc' => '',
  87. # 只有insert时才生效
  88. //'insert' => true,
  89. //'search' => 'date',
  90. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  91. ),
  92. ),
  93. 'manage' => array
  94. (
  95. 'insert' => false,
  96. 'edit' => false,
  97. 'delete' => false,
  98. ),
  99. 'request' => array
  100. (
  101. # 后台搜索用到,也可以不加,自动生成
  102. 'search' => array
  103. (
  104. # 匹配的正则或函数 选填项
  105. 'option' => array
  106. (
  107. 'supplier_id' => array('yes-t_1.supplier_id'),
  108. 'status' => 'yes-t_2.status-1',
  109. 'state' => 'yes-t_2.state-1',
  110. 'state_1' => 'yes-t_1.state-1',
  111. ),
  112. # 联表
  113. 'join' => array
  114. (
  115. array
  116. (
  117. 'table' => 'scm_product/info',
  118. 'type' => 'left join',
  119. 'on' => array('goods_id','id'),
  120. 'col' => 'goods_id',
  121. ),
  122. ),
  123. 'type' => 'all',
  124. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  125. 'col' => '*,t_2.*,t_2.id as value, "" as selected, "" as disabled',
  126. ),
  127. 'getData' => array
  128. (
  129. # 匹配的正则或函数 选填项
  130. 'option' => array
  131. (
  132. 'supplier_id' => array('yes-t_1.supplier_id'),
  133. 'name' => array('yes-t_2.name', 'like'),
  134. 'category' => array('yes-t_2.category', 'like'),
  135. 'top_category_id' => array('yes-t_2.top_category_id'),
  136. 'second_category_id' => array('yes-t_2.second_category_id'),
  137. 'category_id' => array('yes-t_2.category_id'),
  138. 'status' => 'yes-t_2.status-1',
  139. 'state' => 'yes-t_2.state-1',
  140. 'state_1' => 'yes-t_1.state-1',
  141. ),
  142. # 联表
  143. 'join' => array
  144. (
  145. array
  146. (
  147. 'table' => 'scm_product/info',
  148. 'type' => 'left join',
  149. 'on' => array('goods_id','id'),
  150. 'col' => 'goods_id',
  151. ),
  152. ),
  153. 'type' => 'all',
  154. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  155. 'col' => '*,t_2.*',
  156. ),
  157. 'getDataPage' => array
  158. (
  159. # 匹配的正则或函数 选填项
  160. 'option' => array
  161. (
  162. 'supplier_id' => array('yes-t_1.supplier_id'),
  163. 'name' => array('yes-t_2.name', 'like'),
  164. 'category' => array('yes-t_2.category', 'like'),
  165. 'top_category_id' => array('yes-t_2.top_category_id'),
  166. 'second_category_id' => array('yes-t_2.second_category_id'),
  167. 'category_id' => array('yes-t_2.category_id'),
  168. 'status' => 'yes-t_2.status-1',
  169. 'state' => 'yes-t_2.state-1',
  170. 'state_1' => 'yes-t_1.state-1',
  171. ),
  172. # 联表
  173. 'join' => array
  174. (
  175. array
  176. (
  177. 'table' => 'scm_product/info',
  178. 'type' => 'left join',
  179. 'on' => array('goods_id','id'),
  180. 'col' => 'goods_id',
  181. ),
  182. ),
  183. 'type' => 'all',
  184. 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
  185. 'page' => array(10, 'list'),
  186. 'col' => '*,t_2.*',
  187. ),
  188. 'getOne' => array
  189. (
  190. # 匹配的正则或函数 选填项
  191. 'option' => array
  192. (
  193. 'supplier_id' => 'yes',
  194. 'goods_id' => 'yes',
  195. 'sku_id' => 'yes',
  196. 'state' => 1,
  197. ),
  198. 'type' => 'one',
  199. 'col' => '*',
  200. ),
  201. ),
  202. );