buy_stat.php 5.9 KB

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