in_order_goods.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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_product/lib/order.updateGoods?table=scm_servicer/in_order_goods',
  24. 'update' => 'scm_product/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/stock.show', '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. 'batch' => array
  78. (
  79. 'type' => 'varchar-800',
  80. 'name' => '批次号-不输入将自动生成',
  81. 'default' => '',
  82. 'desc' => '批次号',
  83. 'match' => 'option',
  84. 'update' => 'text',
  85. ),
  86. 'cash' => array
  87. (
  88. 'type' => 'decimal-11,2',
  89. 'name' => '单价',
  90. 'default' => '',
  91. 'desc' => '单价',
  92. 'match' => 'option',
  93. ),
  94. 'num' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '数量',
  98. 'default' => '1',
  99. 'desc' => '数量',
  100. 'match' => 'is_numeric',
  101. 'search' => 'select',
  102. 'update' => 'text',
  103. ),
  104. 'status' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '状态',
  108. 'default' => '1',
  109. 'desc' => '状态',
  110. 'match' => 'is_numeric',
  111. //'update' => 'select',
  112. 'option' => $status,
  113. 'search' => 'select',
  114. 'list' => true,
  115. 'edit' => true,
  116. ),
  117. 'state' => array
  118. (
  119. 'type' => 'tinyint-1',
  120. 'name' => '状态',
  121. 'default' => '1',
  122. 'desc' => '请选择状态',
  123. 'match' => 'is_numeric',
  124. ),
  125. 'cdate' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '创建时间',
  129. 'match' => array('is_numeric', time()),
  130. 'desc' => '',
  131. # 只有insert时才生效
  132. 'insert' => true,
  133. 'search' => 'date',
  134. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  135. ),
  136. ),
  137. 'manage' => array
  138. (
  139. 'insert' => false,
  140. 'delete' => false,
  141. 'page_list' => 'in_order_goods',
  142. ),
  143. 'request' => array
  144. (
  145. 'getNum' => array
  146. (
  147. # 匹配的正则或函数 选填项
  148. 'option' => array
  149. (
  150. 'start' => array('yes-t_2.cdate', '>='),
  151. 'end' => array('yes-t_2.cdate', '<='),
  152. 'start_o' => array('yes-t_2.operdate', '>='),
  153. 'end_o' => array('yes-t_2.operdate', '<='),
  154. 'servicer_id' => array('yes-t_2.servicer_id'),
  155. 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
  156. 'goods_id' => array('yes-t_1.goods_id'),
  157. 'status' => array('yes-t_2.status', 'in'),
  158. 'state_2' => 'yes-t_2.state-1',
  159. 'state_1' => 'yes-t_1.state-1',
  160. 'status_1' => 'yes-t_1.status-1',
  161. ),
  162. # 联表
  163. 'join' => array
  164. (
  165. array
  166. (
  167. 'table' => 'scm_servicer/in_order',
  168. 'type' => 'left join',
  169. 'on' => array('order_id','id'),
  170. ),
  171. ),
  172. 'type' => 'all',
  173. 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
  174. 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
  175. ),
  176. ),
  177. );