in_order_goods.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. 'end' => array
  17. (
  18. 'insert' => 'scm_product/lib/order.updateGoods?table=scm_servicer/in_order_goods',
  19. 'update' => 'scm_product/lib/order.updateGoods?table=scm_servicer/in_order_goods',
  20. ),
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. 'update' => 'hidden',
  33. //'list' => true,
  34. ),
  35. 'order_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '订单表id',
  39. 'default' => '',
  40. 'desc' => '订单表id',
  41. 'match' => 'is_numeric',
  42. ),
  43. 'goods' => array
  44. (
  45. 'type' => 'varchar-2000',
  46. 'name' => '商品',
  47. 'default' => '',
  48. 'desc' => '商品',
  49. 'match' => 'option',
  50. 'update' => 'select',
  51. 'update_search' => 'scm_product/lib/manage.searchProduct?{supplier_id}',
  52. ),
  53. 'goods_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '商品',
  57. 'default' => '',
  58. 'desc' => '商品',
  59. 'match' => 'is_numeric',
  60. ),
  61. 'sku_id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => 'sku_id',
  65. 'default' => '-1',
  66. 'desc' => 'sku_id',
  67. 'match' => 'is_numeric',
  68. ),
  69. 'cash' => array
  70. (
  71. 'type' => 'decimal-11,2',
  72. 'name' => '单价',
  73. 'default' => '',
  74. 'desc' => '单价',
  75. 'match' => 'option',
  76. ),
  77. 'num' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '数量',
  81. 'default' => '1',
  82. 'desc' => '数量',
  83. 'match' => 'is_numeric',
  84. 'search' => 'select',
  85. 'update' => 'text',
  86. ),
  87. 'status' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '状态',
  91. 'default' => '1',
  92. 'desc' => '状态',
  93. 'match' => 'is_numeric',
  94. //'update' => 'select',
  95. 'option' => $status,
  96. 'search' => 'select',
  97. 'list' => true,
  98. 'edit' => true,
  99. ),
  100. 'state' => array
  101. (
  102. 'type' => 'tinyint-1',
  103. 'name' => '状态',
  104. 'default' => '1',
  105. 'desc' => '请选择状态',
  106. 'match' => 'is_numeric',
  107. ),
  108. 'cdate' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '创建时间',
  112. 'match' => array('is_numeric', time()),
  113. 'desc' => '',
  114. # 只有insert时才生效
  115. 'insert' => true,
  116. 'search' => 'date',
  117. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  118. ),
  119. ),
  120. 'manage' => array
  121. (
  122. 'insert' => false,
  123. 'delete' => false,
  124. ),
  125. 'request' => array
  126. (
  127. 'getNum' => array
  128. (
  129. # 匹配的正则或函数 选填项
  130. 'option' => array
  131. (
  132. 'start' => array('yes-t_2.cdate', '>='),
  133. 'end' => array('yes-t_2.cdate', '<='),
  134. 'start_o' => array('yes-t_2.operdate', '>='),
  135. 'end_o' => array('yes-t_2.operdate', '<='),
  136. 'servicer_id' => array('yes-t_2.servicer_id'),
  137. 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
  138. 'goods_id' => array('yes-t_1.goods_id'),
  139. 'status' => array('yes-t_2.status', 'in'),
  140. 'state_2' => 'yes-t_2.state-1',
  141. 'state_1' => 'yes-t_1.state-1',
  142. 'status_1' => 'yes-t_1.status-1',
  143. ),
  144. # 联表
  145. 'join' => array
  146. (
  147. array
  148. (
  149. 'table' => 'scm_servicer/in_order',
  150. 'type' => 'left join',
  151. 'on' => array('order_id','id'),
  152. ),
  153. ),
  154. 'type' => 'all',
  155. 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
  156. 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
  157. ),
  158. ),
  159. );