goods_log.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'goods_log',
  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. 'sid' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'sid',
  26. 'default' => '',
  27. 'desc' => 'sid',
  28. 'search' => 'hidden',
  29. 'match' => 'is_numeric',
  30. ),
  31. 'store_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '仓库名称',
  35. 'default' => '',
  36. 'desc' => '仓库名称',
  37. 'match' => 'is_numeric',
  38. 'list' => 'Dever::load("store/info-find#name", {store_id})',
  39. 'search' => array
  40. (
  41. 'api' => 'store/info-like',
  42. 'col' => 'name',
  43. 'result' => 'id',
  44. ),
  45. 'search' => 'hidden',
  46. 'list_order' => 1,
  47. ),
  48. 'goods-info-code'=> array
  49. (
  50. 'name' => '商品编码',
  51. 'default' => '',
  52. 'desc' => '商品编码',
  53. 'match' => 'option',
  54. # 读取另外表的关联方式
  55. 'sync' => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
  56. 'list' => true,
  57. 'list_order' => 2,
  58. ),
  59. 'goods_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '商品名称',
  63. 'default' => '',
  64. 'desc' => '商品名称',
  65. 'match' => 'is_numeric',
  66. 'search' => array
  67. (
  68. 'api' => 'goods/info-like',
  69. 'col' => 'name',
  70. 'result' => 'id',
  71. ),
  72. 'list' => 'Dever::load("goods/info-find#name", {goods_id})',
  73. 'list_order' => 3,
  74. ),
  75. 'sku_id' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '规格型号',
  79. 'default' => '-1',
  80. 'desc' => '规格型号',
  81. 'match' => 'is_numeric',
  82. 'search' => 'hidden',
  83. 'list' => 'Dever::load("shop/lib/manage.getSku", {goods_id}, {sku_id})',
  84. 'list_order' => 4,
  85. ),
  86. 'cur_num' => array
  87. (
  88. 'type' => 'float-11,2',
  89. 'name' => '当前库存',
  90. 'default' => '0',
  91. 'desc' => '新增库存',
  92. 'match' => 'is_numeric',
  93. 'list_name' => '当前库存',
  94. 'list' => true,
  95. 'list_order' => 5,
  96. ),
  97. 'sell_num' => array
  98. (
  99. 'type' => 'float-11,2',
  100. 'name' => '占用库存',
  101. 'default' => '0',
  102. 'desc' => '占用库存',
  103. 'match' => 'option',
  104. 'list' => true,
  105. 'list_order' => 6,
  106. ),
  107. 'online_num' => array
  108. (
  109. 'type' => 'float-11,2',
  110. 'name' => '在途库存',
  111. 'default' => '0',
  112. 'desc' => '在途库存',
  113. 'match' => 'option',
  114. //'search' => 'order',
  115. 'list' => true,
  116. 'list_order' => 7,
  117. ),
  118. 'total_num' => array
  119. (
  120. 'type' => 'float-11,2',
  121. 'name' => '总库存',
  122. 'default' => '0',
  123. 'desc' => '总库存',
  124. 'match' => 'is_numeric',
  125. 'list' => true,
  126. 'list_order' => 8,
  127. ),
  128. 'num' => array
  129. (
  130. 'type' => 'float-11,2',
  131. 'name' => '调整数量',
  132. 'default' => '0',
  133. 'desc' => '调整数量',
  134. 'match' => 'is_numeric',
  135. 'list' => true,
  136. 'list_order' => 9,
  137. ),
  138. 'after_cur_num' => array
  139. (
  140. 'type' => 'float-11,2',
  141. 'name' => '调整后库存',
  142. 'default' => '0',
  143. 'desc' => '调整后库存',
  144. 'match' => 'is_numeric',
  145. 'list' => true,
  146. 'list_order' => 10,
  147. ),
  148. 'after_total_num' => array
  149. (
  150. 'type' => 'float-11,2',
  151. 'name' => '调整后总库存',
  152. 'default' => '0',
  153. 'desc' => '调整后总库存',
  154. 'match' => 'is_numeric',
  155. 'list' => true,
  156. 'list_order' => 11,
  157. ),
  158. 'state' => array
  159. (
  160. 'type' => 'tinyint-1',
  161. 'name' => '数据状态',
  162. 'default' => '1',
  163. 'desc' => '请选择状态',
  164. 'match' => 'is_numeric',
  165. ),
  166. 'cdate' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '调整时间',
  170. 'match' => array('is_numeric', time()),
  171. 'desc' => '',
  172. # 只有insert时才生效
  173. 'insert' => true,
  174. 'search' => 'sday',
  175. 'list' => 'date("Y-m-d H:i", {cdate})',
  176. 'list_order' => 13,
  177. ),
  178. ),
  179. 'alter' => array
  180. (
  181. 2 => array
  182. (
  183. array('update', 'cur_num', 'cur_num', 'float-11,2 0 当前库存'),
  184. array('update', 'sell_num', 'sell_num', 'float-11,2 0 占用库存'),
  185. array('update', 'online_num', 'online_num', 'float-11,2 0 在途库存'),
  186. array('update', 'total_num', 'total_num', 'float-11,2 0 总库存'),
  187. array('update', 'num', 'num', 'float-11,2 0 调整后数量'),
  188. array('update', 'after_cur_num', 'after_cur_num', 'float-11,2 0 调整后库存'),
  189. array('update', 'after_total_num', 'after_total_num', 'float-11,2 0 调整后总库存'),
  190. ),
  191. 'version' => 2,
  192. ),
  193. 'manage' => array
  194. (
  195. 'insert' => false,
  196. 'edit' => false,
  197. 'delete' => false,
  198. 'num' => false,
  199. 'excel' => true,
  200. ),
  201. # request 请求接口定义
  202. 'request' => array
  203. (
  204. 'getDataByDate' => array
  205. (
  206. # 匹配的正则或函数 选填项
  207. 'option' => array
  208. (
  209. 'store_id' => 'yes',
  210. 'status' => 'yes',
  211. 'start' => array('yes-cdate', '>='),
  212. 'end' => array('yes-cdate', '<='),
  213. 'sku_id' => array('yes', 'in'),
  214. 'goods_id' => array('yes', 'in'),
  215. 'state' => 1,
  216. ),
  217. 'type' => 'all',
  218. 'order' => array('store_id' => 'desc', 'goods_id' => 'desc', 'id' => 'desc'),
  219. 'col' => '*',
  220. ),
  221. ),
  222. );
  223. return $config;