in_order_goods.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待审',
  5. 2 => '已审核',
  6. 3 => '未通过',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'in_order_goods',
  12. # 显示给用户看的名称
  13. 'lang' => '订单商品表',
  14. 'menu' => false,
  15. 'status' => $status,
  16. # 验证供应商商品是否存在
  17. 'start' => array
  18. (
  19. 'insert' => 'scm_seller/lib/manage.check',
  20. ),
  21. 'end' => array
  22. (
  23. 'insert' => 'scm/lib/order.updateGoods?table=scm_seller/in_order_goods',
  24. 'update' => 'scm/lib/order.updateGoods?table=scm_seller/in_order_goods',
  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. 'update' => 'hidden',
  38. //'list' => true,
  39. ),
  40. 'order_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '订单表id',
  44. 'default' => '',
  45. 'desc' => '订单表id',
  46. 'match' => 'is_numeric',
  47. ),
  48. 'goods' => array
  49. (
  50. 'type' => 'varchar-2000',
  51. 'name' => '商品',
  52. 'default' => '',
  53. 'desc' => '商品',
  54. 'match' => 'option',
  55. 'update' => 'select',
  56. 'update_search' => 'scm_product/lib/manage.searchProduct?{supplier_id}',
  57. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showInfo?cash_col=buy_price', 'scm_product'), 'col' => 'seller_shop_id,source_type,source_id')),
  58. ),
  59. 'goods_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '库存',
  63. 'default' => '',
  64. 'desc' => '商品',
  65. 'match' => 'is_numeric',
  66. 'update' => 'show',
  67. 'value' => '暂无',
  68. ),
  69. 'sku_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => 'sku_id',
  73. 'default' => '-1',
  74. 'desc' => 'sku_id',
  75. 'match' => 'is_numeric',
  76. ),
  77. 'shop_goods_list_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '关联仓库商品id',
  81. 'default' => '',
  82. 'desc' => '关联仓库商品id',
  83. 'match' => 'is_numeric',
  84. 'value' => '暂无',
  85. ),
  86. 'unit_id' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '单位',
  90. 'default' => '',
  91. 'desc' => '单位',
  92. 'match' => 'is_numeric',
  93. 'update' => 'select',
  94. 'option' => array(0 => '请先选择商品'),
  95. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showPriceByUnit?cash_col=buy_price', 'scm_product'), 'col' => 'source_type,source_id,seller_shop_id,goods')),
  96. ),
  97. 'batch' => array
  98. (
  99. 'type' => 'varchar-800',
  100. 'name' => '入库批次号',
  101. 'default' => '',
  102. 'desc' => '批次号',
  103. 'match' => 'option',
  104. 'update' => 'text',
  105. 'value' => date('Ymd'),
  106. ),
  107. 'sdate' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '生产日期',
  111. 'default' => '',
  112. 'desc' => '生产日期',
  113. 'match' => 'option',
  114. 'update' => 'day',
  115. 'callback' => 'maketime',
  116. ),
  117. 'cash' => array
  118. (
  119. 'type' => 'decimal-11,2',
  120. 'name' => '单价',
  121. 'default' => '',
  122. 'desc' => '单价',
  123. 'match' => 'option',
  124. 'update' => 'text',
  125. ),
  126. 'num' => array
  127. (
  128. 'type' => 'decimal-11,2',
  129. 'name' => '数量',
  130. 'default' => '1',
  131. 'desc' => '数量',
  132. 'match' => 'option',
  133. 'update' => 'text',
  134. ),
  135. 'status' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '状态',
  139. 'default' => '1',
  140. 'desc' => '状态',
  141. 'match' => 'is_numeric',
  142. //'update' => 'select',
  143. 'option' => $status,
  144. 'search' => 'select',
  145. 'list' => true,
  146. 'edit' => true,
  147. ),
  148. 'state' => array
  149. (
  150. 'type' => 'tinyint-1',
  151. 'name' => '状态',
  152. 'default' => '1',
  153. 'desc' => '请选择状态',
  154. 'match' => 'is_numeric',
  155. ),
  156. 'cdate' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '创建时间',
  160. 'match' => array('is_numeric', time()),
  161. 'desc' => '',
  162. # 只有insert时才生效
  163. 'insert' => true,
  164. 'search' => 'date',
  165. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  166. ),
  167. ),
  168. 'manage' => array
  169. (
  170. 'insert' => false,
  171. 'delete' => false,
  172. 'page_list' => 'order_goods',
  173. ),
  174. 'request' => array
  175. (
  176. 'getNum' => array
  177. (
  178. # 匹配的正则或函数 选填项
  179. 'option' => array
  180. (
  181. 'start' => array('yes-t_2.cdate', '>='),
  182. 'end' => array('yes-t_2.cdate', '<='),
  183. 'start_o' => array('yes-t_2.operdate', '>='),
  184. 'end_o' => array('yes-t_2.operdate', '<='),
  185. 'seller_id' => array('yes-t_2.seller_id'),
  186. 'seller_shop_id' => array('yes-t_2.seller_shop_id'),
  187. 'goods_id' => array('yes-t_1.goods_id'),
  188. 'status' => array('yes-t_2.status', 'in'),
  189. 'state_2' => 'yes-t_2.state-1',
  190. 'state_1' => 'yes-t_1.state-1',
  191. 'status_1' => 'yes-t_1.status-1',
  192. ),
  193. # 联表
  194. 'join' => array
  195. (
  196. array
  197. (
  198. 'table' => 'scm_seller/in_order',
  199. 'type' => 'left join',
  200. 'on' => array('order_id','id'),
  201. ),
  202. ),
  203. 'type' => 'all',
  204. 'group' => 't_2.seller_id, t_2.seller_shop_id, t_1.goods_id',
  205. 'col' => 'id,t_2.seller_id, t_2.seller_shop_id, t_1.goods_id,sum(t_1.num) as num',
  206. ),
  207. ),
  208. );