buy_stat.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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' => 'user',
  43. 'option' => array(
  44. 'day' => '按天',
  45. 'week' => '按周',
  46. 'month' => '按月',
  47. ),
  48. ),
  49. 'order' => 'desc',
  50. 'list' => 'Dever::showDay("{day}")',
  51. ),
  52. 'shop_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '所属门店',
  56. 'default' => '',
  57. 'desc' => '所属门店',
  58. 'match' => 'is_numeric',
  59. 'option' => $shop,
  60. 'update' => 'hidden',
  61. 'value' => Dever::input('search_option_shop_id'),
  62. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  63. ),
  64. 'area' => array
  65. (
  66. 'type' => 'varchar-500',
  67. 'name' => '选择地区',
  68. 'default' => '',
  69. 'desc' => '选择地区',
  70. 'match' => 'option',
  71. 'search' => 'linkage',
  72. 'update' => 'linkage',
  73. 'option' => Dever::url('api.get?level_total=4', 'area'),
  74. //'list' => 'Dever::load("area/api.string", "{area}")',
  75. ),
  76. 'province' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '省份',
  80. 'default' => '',
  81. 'desc' => '省份',
  82. 'match' => 'option',
  83. //'update' => 'text',
  84. ),
  85. 'city' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '城市',
  89. 'default' => '',
  90. 'desc' => '城市',
  91. 'match' => 'option',
  92. //'update' => 'text',
  93. ),
  94. 'county' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '县区',
  98. 'default' => '',
  99. 'desc' => '县区',
  100. 'match' => 'option',
  101. //'update' => 'text',
  102. ),
  103. 'town' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '街道',
  107. 'default' => '',
  108. 'desc' => '街道',
  109. 'match' => 'option',
  110. //'update' => 'text',
  111. ),
  112. 'order' => array
  113. (
  114. 'type' => 'varchar-100',
  115. 'name' => '订货单数',
  116. 'default' => '0',
  117. 'desc' => '订货单数',
  118. 'match' => 'option',
  119. 'update' => 'text',
  120. 'list' => true,
  121. ),
  122. 'goods' => array
  123. (
  124. 'type' => 'varchar-100',
  125. 'name' => '商品数量',
  126. 'default' => '0',
  127. 'desc' => '商品数',
  128. 'match' => 'option',
  129. 'update' => 'text',
  130. 'list' => true,
  131. ),
  132. 'cash' => array
  133. (
  134. 'type' => 'varchar-100',
  135. 'name' => '采购金额',
  136. 'default' => '0',
  137. 'desc' => '采购金额',
  138. 'match' => 'option',
  139. 'update' => 'text',
  140. 'list' => true,
  141. ),
  142. 'p_cash' => array
  143. (
  144. 'type' => 'varchar-100',
  145. 'name' => '出厂价',
  146. 'default' => '0',
  147. 'desc' => '出厂价',
  148. 'match' => 'option',
  149. 'update' => 'text',
  150. 'list_name' => '毛利',
  151. 'list' => '"{cash}-{p_cash}"',
  152. ),
  153. 'state' => array
  154. (
  155. 'type' => 'tinyint-1',
  156. 'name' => '状态',
  157. 'default' => '1',
  158. 'desc' => '请选择状态',
  159. 'match' => 'is_numeric',
  160. ),
  161. 'cdate' => array
  162. (
  163. 'type' => 'int-11',
  164. 'name' => '生成时间',
  165. 'match' => array('is_numeric', time()),
  166. 'desc' => '',
  167. # 只有insert时才生效
  168. 'insert' => true,
  169. //'search' => 'date',
  170. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  171. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  172. ),
  173. ),
  174. 'manage' => array
  175. (
  176. 'delete' => false,
  177. 'edit' => false,
  178. 'insert' => false,
  179. 'excel' => true,
  180. ),
  181. 'request' => array
  182. (
  183. # 获取总金额
  184. 'getAll' => array
  185. (
  186. # 匹配的正则或函数 选填项
  187. 'option' => array
  188. (
  189. 'start' => array('yes-day', '>='),
  190. 'end' => array('yes-day', '<='),
  191. 'shop_id' => 'yes',
  192. 'state' => 1,
  193. ),
  194. 'type' => 'all',
  195. 'col' => '*',
  196. ),
  197. ),
  198. );