buy_stat.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. $shop = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('shop/info')->select();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'buy_stat',
  16. # 显示给用户看的名称
  17. 'lang' => '采购额统计',
  18. 'order' => -10,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. //'list' => true,
  31. ),
  32. 'day' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '日期',
  36. 'default' => '',
  37. 'match' => 'is_numeric',
  38. 'desc' => '',
  39. 'search' => 'day',
  40. 'search_button' => array
  41. (
  42. 'sum' => 'cash,`order`,goods',
  43. 'option' => array(
  44. 'day' => '按天',
  45. 'week' => '按周',
  46. 'month' => '按月',
  47. ),
  48. 'group' => 'shop_id',
  49. ),
  50. 'order' => 'desc',
  51. 'list' => 'Dever::showDay("{day}")',
  52. ),
  53. 'shop_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '门店名称',
  57. 'default' => '',
  58. 'desc' => '门店名称',
  59. 'match' => 'is_numeric',
  60. 'search' => 'select',
  61. //'option' => $shop,
  62. 'update' => 'hidden',
  63. 'search' => 'hidden',
  64. 'search' => array
  65. (
  66. 'api' => 'shop/info-like',
  67. 'col' => 'name',
  68. 'result' => 'id',
  69. ),
  70. 'value' => Dever::input('search_option_shop_id'),
  71. 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  72. ),
  73. 'area' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '所在街道',
  77. 'default' => '',
  78. 'desc' => '所在街道',
  79. 'match' => 'option',
  80. 'search' => 'linkage',
  81. 'update' => 'linkage',
  82. 'option' => Dever::url('lib/area.get', 'shop'),
  83. //'list' => 'Dever::load("area/api.string", "{area}")',
  84. ),
  85. 'province' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '省份',
  89. 'default' => '',
  90. 'desc' => '省份',
  91. 'match' => 'option',
  92. //'update' => 'text',
  93. ),
  94. 'city' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '城市',
  98. 'default' => '',
  99. 'desc' => '城市',
  100. 'match' => 'option',
  101. //'update' => 'text',
  102. ),
  103. 'county' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '县区',
  107. 'default' => '',
  108. 'desc' => '县区',
  109. 'match' => 'option',
  110. //'update' => 'text',
  111. ),
  112. 'town' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '街道',
  116. 'default' => '',
  117. 'desc' => '街道',
  118. 'match' => 'option',
  119. //'update' => 'text',
  120. ),
  121. 'order' => array
  122. (
  123. 'type' => 'varchar-100',
  124. 'name' => '订货单数',
  125. 'default' => '0',
  126. 'desc' => '订货单数',
  127. 'match' => 'option',
  128. 'update' => 'text',
  129. 'list' => true,
  130. ),
  131. 'goods' => array
  132. (
  133. 'type' => 'varchar-100',
  134. 'name' => '商品数量',
  135. 'default' => '0',
  136. 'desc' => '商品数',
  137. 'match' => 'option',
  138. 'update' => 'text',
  139. 'list' => true,
  140. ),
  141. 'cash' => array
  142. (
  143. 'type' => 'varchar-100',
  144. 'name' => '采购金额',
  145. 'default' => '0',
  146. 'desc' => '采购金额',
  147. 'match' => 'option',
  148. 'update' => 'text',
  149. 'list' => true,
  150. ),
  151. 'p_cash' => array
  152. (
  153. 'type' => 'varchar-100',
  154. 'name' => '出厂价',
  155. 'default' => '0',
  156. 'desc' => '出厂价',
  157. 'match' => 'option',
  158. 'update' => 'text',
  159. 'list_name' => '毛利',
  160. 'list' => 'Dever::load("shop/lib/manage.showCash", "{cash}", "{p_cash}")',
  161. ),
  162. 'state' => array
  163. (
  164. 'type' => 'tinyint-1',
  165. 'name' => '状态',
  166. 'default' => '1',
  167. 'desc' => '请选择状态',
  168. 'match' => 'is_numeric',
  169. ),
  170. 'cdate' => array
  171. (
  172. 'type' => 'int-11',
  173. 'name' => '生成时间',
  174. 'match' => array('is_numeric', time()),
  175. 'desc' => '',
  176. # 只有insert时才生效
  177. 'insert' => true,
  178. //'search' => 'date',
  179. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  180. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  181. ),
  182. ),
  183. 'manage' => array
  184. (
  185. 'delete' => false,
  186. 'edit' => false,
  187. 'insert' => false,
  188. 'excel' => true,
  189. ),
  190. 'request' => array
  191. (
  192. # 获取总金额
  193. 'getAll' => array
  194. (
  195. # 匹配的正则或函数 选填项
  196. 'option' => array
  197. (
  198. 'start' => array('yes-day', '>='),
  199. 'end' => array('yes-day', '<='),
  200. 'shop_id' => 'yes',
  201. 'state' => 1,
  202. ),
  203. 'type' => 'all',
  204. 'col' => '*',
  205. ),
  206. ),
  207. );