in_order_goods.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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_supplier/lib/manage.check',
  20. ),
  21. 'end' => array
  22. (
  23. 'insert' => 'scm/lib/order.updateGoods?table=scm_servicer/in_order_goods',
  24. 'update' => 'scm/lib/order.updateGoods?table=scm_servicer/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', 'scm_product'), 'col' => 'servicer_store_id,supplier_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. 'sdate' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '生产日期',
  102. 'default' => '',
  103. 'desc' => '生产日期',
  104. 'match' => 'option',
  105. 'update' => 'day',
  106. 'callback' => 'maketime',
  107. ),
  108. 'cash' => array
  109. (
  110. 'type' => 'decimal-11,2',
  111. 'name' => '单价',
  112. 'default' => '',
  113. 'desc' => '单价',
  114. 'match' => 'option',
  115. 'update' => 'text',
  116. ),
  117. 'num' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '数量',
  121. 'default' => '1',
  122. 'desc' => '数量',
  123. 'match' => 'is_numeric',
  124. 'search' => 'select',
  125. 'update' => 'text',
  126. ),
  127. 'status' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '状态',
  131. 'default' => '1',
  132. 'desc' => '状态',
  133. 'match' => 'is_numeric',
  134. //'update' => 'select',
  135. 'option' => $status,
  136. 'search' => 'select',
  137. 'list' => true,
  138. 'edit' => true,
  139. ),
  140. 'state' => array
  141. (
  142. 'type' => 'tinyint-1',
  143. 'name' => '状态',
  144. 'default' => '1',
  145. 'desc' => '请选择状态',
  146. 'match' => 'is_numeric',
  147. ),
  148. 'cdate' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '创建时间',
  152. 'match' => array('is_numeric', time()),
  153. 'desc' => '',
  154. # 只有insert时才生效
  155. 'insert' => true,
  156. 'search' => 'date',
  157. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  158. ),
  159. ),
  160. 'manage' => array
  161. (
  162. 'insert' => false,
  163. 'delete' => false,
  164. 'page_list' => 'in_order_goods',
  165. ),
  166. 'request' => array
  167. (
  168. 'getNum' => array
  169. (
  170. # 匹配的正则或函数 选填项
  171. 'option' => array
  172. (
  173. 'start' => array('yes-t_2.cdate', '>='),
  174. 'end' => array('yes-t_2.cdate', '<='),
  175. 'start_o' => array('yes-t_2.operdate', '>='),
  176. 'end_o' => array('yes-t_2.operdate', '<='),
  177. 'servicer_id' => array('yes-t_2.servicer_id'),
  178. 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
  179. 'goods_id' => array('yes-t_1.goods_id'),
  180. 'status' => array('yes-t_2.status', 'in'),
  181. 'state_2' => 'yes-t_2.state-1',
  182. 'state_1' => 'yes-t_1.state-1',
  183. 'status_1' => 'yes-t_1.status-1',
  184. ),
  185. # 联表
  186. 'join' => array
  187. (
  188. array
  189. (
  190. 'table' => 'scm_servicer/in_order',
  191. 'type' => 'left join',
  192. 'on' => array('order_id','id'),
  193. ),
  194. ),
  195. 'type' => 'all',
  196. 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
  197. 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
  198. ),
  199. ),
  200. );