store_goods_list.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'store_goods_list',
  6. # 显示给用户看的名称
  7. 'lang' => '商品价格设置',
  8. 'order' => 200,
  9. 'menu' => false,
  10. # 数据结构 不同的字段放这里
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'list' => true,
  21. ),
  22. 'servicer_store_id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '所属配送商',
  26. 'default' => '',
  27. 'desc' => '所属配送商',
  28. 'match' => 'is_numeric',
  29. 'update' => 'hidden',
  30. 'search' => 'hidden',
  31. 'value' => Dever::input('search_option_servicer_store_id'),
  32. 'list' => 'Dever::load("scm_servicer/store-one#name", {servicer_store_id})',
  33. ),
  34. 'store_goods_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '仓库商品id',
  38. 'default' => '',
  39. 'desc' => '仓库商品id',
  40. 'match' => 'is_numeric',
  41. ),
  42. 'unit_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '单位',
  46. 'default' => '',
  47. 'desc' => '单位',
  48. 'match' => 'is_numeric',
  49. //'update' => 'select',
  50. ),
  51. 'batch' => array
  52. (
  53. 'type' => 'varchar-800',
  54. 'name' => '入库批次号',
  55. 'default' => '',
  56. 'desc' => '入库批次号',
  57. 'match' => 'option',
  58. ),
  59. 'sdate' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '生产日期',
  63. 'default' => '',
  64. 'desc' => '生产日期',
  65. 'match' => 'option',
  66. 'update' => 'day',
  67. 'callback' => 'maketime',
  68. ),
  69. 'cash' => array
  70. (
  71. 'type' => 'decimal-11,2',
  72. 'name' => '入库单价',
  73. 'default' => '',
  74. 'desc' => '入库单价',
  75. 'match' => 'option',
  76. ),
  77. 'in_num' => array
  78. (
  79. 'type' => 'decimal-11,2',
  80. 'name' => '入库库存',
  81. 'default' => '0',
  82. 'desc' => '入库库存',
  83. 'match' => 'is_numeric',
  84. ),
  85. 'out_num' => array
  86. (
  87. 'type' => 'decimal-11,2',
  88. 'name' => '出库库存',
  89. 'default' => '0',
  90. 'desc' => '出库库存',
  91. 'match' => 'option',
  92. ),
  93. 'state' => array
  94. (
  95. 'type' => 'tinyint-1',
  96. 'name' => '数据状态',
  97. 'default' => '1',
  98. 'desc' => '请选择状态',
  99. 'match' => 'is_numeric',
  100. ),
  101. 'cdate' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '发布时间',
  105. 'match' => array('is_numeric', time()),
  106. 'desc' => '',
  107. # 只有insert时才生效
  108. 'insert' => true,
  109. //'search' => 'date',
  110. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  111. ),
  112. ),
  113. 'manage' => array
  114. (
  115. 'insert' => false,
  116. 'edit' => false,
  117. 'delete' => false,
  118. //'excel' => array(array('导出门店库存', '门店库存', '')),
  119. 'page_list_table' => 'sku',
  120. ),
  121. # request 请求接口定义
  122. 'request' => array
  123. (
  124. # 列表 先入先出
  125. 'getList' => array
  126. (
  127. # 匹配的正则或函数 选填项
  128. 'option' => array
  129. (
  130. 'servicer_store_id' => 'yes',
  131. 'goods_id' => 'yes',
  132. 'sku_id' => 'yes',
  133. 'state' => 1,
  134. ),
  135. 'type' => 'all',
  136. 'order' => array('sdate' => 'asc', 'batch' => 'asc', 'id' => 'asc'),
  137. 'col' => '*,in_num-out_num as total',
  138. ),
  139. # 获取某个sku的单条数据
  140. 'getOne' => array
  141. (
  142. # 匹配的正则或函数 选填项
  143. 'option' => array
  144. (
  145. 'servicer_store_id' => 'yes',
  146. 'goods_id' => 'yes',
  147. 'sku_id' => 'yes',
  148. 'state' => 1,
  149. ),
  150. 'type' => 'one',
  151. 'col' => '*,(sum(in_num)-sum(out_num)) as total,AVG(cash) as cash',
  152. ),
  153. # 获取单位下的数据
  154. 'getUnit' => array
  155. (
  156. # 匹配的正则或函数 选填项
  157. 'option' => array
  158. (
  159. 'servicer_store_id' => 'yes',
  160. 'goods_id' => 'yes',
  161. 'sku_id' => 'yes',
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'group' => 'unit_id',
  166. 'col' => '*,(sum(in_num)-sum(out_num)) as total,AVG(cash) as cash|unit_id',
  167. ),
  168. # 更新入库库存
  169. 'inUpdate' => array
  170. (
  171. 'type' => 'update',
  172. 'where' => array
  173. (
  174. 'id' => 'yes',
  175. ),
  176. 'set' => array
  177. (
  178. 'in_num' => array('yes', '+='),
  179. ),
  180. ),
  181. # 更新出库库存
  182. 'outUpdate' => array
  183. (
  184. 'type' => 'update',
  185. 'where' => array
  186. (
  187. 'id' => 'yes',
  188. ),
  189. 'set' => array
  190. (
  191. 'out_num' => array('yes', '+='),
  192. ),
  193. ),
  194. # 更新入库在途库存
  195. 'onInUpdate' => array
  196. (
  197. 'type' => 'update',
  198. 'where' => array
  199. (
  200. 'id' => 'yes',
  201. ),
  202. 'set' => array
  203. (
  204. 'on_in_num' => array('yes', '+='),
  205. ),
  206. ),
  207. # 更新出库在途库存
  208. 'onOutUpdate' => array
  209. (
  210. 'type' => 'update',
  211. 'where' => array
  212. (
  213. 'id' => 'yes',
  214. ),
  215. 'set' => array
  216. (
  217. 'on_out_num' => array('yes', '+='),
  218. ),
  219. ),
  220. ),
  221. );
  222. return $config;