out_order_goods.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待审',
  5. 2 => '已审核',
  6. 3 => '未通过',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'out_order_goods',
  12. # 显示给用户看的名称
  13. 'lang' => '订单商品表',
  14. 'menu' => false,
  15. 'status' => $status,
  16. # 验证库存
  17. 'start' => array
  18. (
  19. 'insert' => 'scm/lib/stock.out_check?table=scm_servicer/store_goods_sku&col=servicer_store_id',
  20. ),
  21. 'end' => array
  22. (
  23. 'insert' => 'scm/lib/order.updateGoods?table=scm_servicer/out_order_goods',
  24. 'update' => 'scm/lib/order.updateGoods?table=scm_servicer/out_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?{servicer_id,servicer_store_id}',
  57. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showInfo', 'scm_product'), 'col' => 'servicer_store_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. 'unit_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '单位',
  81. 'default' => '',
  82. 'desc' => '单位',
  83. 'match' => 'is_numeric',
  84. 'update' => 'select',
  85. 'option' => array(0 => '请先选择商品'),
  86. 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showPriceByUnit', 'scm_product'), 'col' => 'supplier_id,goods')),
  87. ),
  88. 'batch' => array
  89. (
  90. 'type' => 'varchar-800',
  91. 'name' => '批次号',
  92. 'default' => '',
  93. 'desc' => '批次号',
  94. 'match' => 'option',
  95. 'update' => 'text',
  96. 'value' => date('Ymd'),
  97. ),
  98. 'cash' => array
  99. (
  100. 'type' => 'decimal-11,2',
  101. 'name' => '单价',
  102. 'default' => '',
  103. 'desc' => '单价',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. ),
  107. 'num' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '出库数量',
  111. 'default' => '1',
  112. 'desc' => '数量',
  113. 'match' => 'is_numeric',
  114. 'search' => 'select',
  115. 'update' => 'text',
  116. ),
  117. 'status' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '状态',
  121. 'default' => '1',
  122. 'desc' => '状态',
  123. 'match' => 'is_numeric',
  124. //'update' => 'select',
  125. 'option' => $status,
  126. 'search' => 'select',
  127. 'list' => true,
  128. 'edit' => true,
  129. ),
  130. 'state' => array
  131. (
  132. 'type' => 'tinyint-1',
  133. 'name' => '状态',
  134. 'default' => '1',
  135. 'desc' => '请选择状态',
  136. 'match' => 'is_numeric',
  137. ),
  138. 'cdate' => array
  139. (
  140. 'type' => 'int-11',
  141. 'name' => '创建时间',
  142. 'match' => array('is_numeric', time()),
  143. 'desc' => '',
  144. # 只有insert时才生效
  145. 'insert' => true,
  146. 'search' => 'date',
  147. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  148. ),
  149. ),
  150. 'manage' => array
  151. (
  152. 'insert' => false,
  153. 'delete' => false,
  154. 'page_list' => 'in_order_goods',
  155. ),
  156. 'request' => array
  157. (
  158. 'getNum' => array
  159. (
  160. # 匹配的正则或函数 选填项
  161. 'option' => array
  162. (
  163. 'start' => array('yes-t_2.cdate', '>='),
  164. 'end' => array('yes-t_2.cdate', '<='),
  165. 'start_o' => array('yes-t_2.operdate', '>='),
  166. 'end_o' => array('yes-t_2.operdate', '<='),
  167. 'servicer_id' => array('yes-t_2.servicer_id'),
  168. 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
  169. 'goods_id' => array('yes-t_1.goods_id'),
  170. 'status' => array('yes-t_2.status', 'in'),
  171. 'state_2' => 'yes-t_2.state-1',
  172. 'state_1' => 'yes-t_1.state-1',
  173. 'status_1' => 'yes-t_1.status-1',
  174. ),
  175. # 联表
  176. 'join' => array
  177. (
  178. array
  179. (
  180. 'table' => 'scm_servicer/out_order',
  181. 'type' => 'left join',
  182. 'on' => array('order_id','id'),
  183. ),
  184. ),
  185. 'type' => 'all',
  186. 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
  187. 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
  188. ),
  189. ),
  190. );