Console.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace Manage\Plugin;
  3. use Dever;
  4. class Console
  5. {
  6. public function data()
  7. {
  8. $where['start'] = Dever::maketime(date('Y-m-d 00:00:00'));
  9. $where['end'] = Dever::maketime(date('Y-m-d 23:59:59'));
  10. $where['status'] = '1,2,3,4,5,6';
  11. $today_sell_cash = Dever::db('shop/sell_order')->getCashNum($where);
  12. $today_sell_order = Dever::db('shop/sell_order')->getOrderNum($where);
  13. $where['status'] = '1,2,3,4,5,6';
  14. $today_buy_cash = Dever::db('shop/buy_order')->getCashNum($where);
  15. $today_buy_order = Dever::db('shop/buy_order')->getOrderNum($where);
  16. $today_user = Dever::db('passport/user')->total($where);
  17. $user = Dever::db('passport/user')->total();
  18. $shop = Dever::db('shop/info')->total();
  19. $factory = Dever::db('factory/info')->total();
  20. $store = Dever::db('store/info')->total();
  21. $total = 0;
  22. $data[] = array
  23. (
  24. 'name' => '当日销售额',
  25. 'num' => $today_sell_cash['total'] ? round($today_sell_cash['total'], 2) : 0,
  26. 'href' => '#',
  27. );
  28. $data[] = array
  29. (
  30. 'name' => '销售订单量',
  31. 'num' => $today_sell_order,
  32. 'href' => '#',
  33. );
  34. $data[] = array
  35. (
  36. 'name' => '采购额',
  37. 'num' => $today_buy_cash['total'] ? round($today_buy_cash['total'], 2) : 0,
  38. 'href' => '#',
  39. );
  40. $data[] = array
  41. (
  42. 'name' => '采购订单量',
  43. 'num' => $today_buy_order,
  44. 'href' => '#',
  45. );
  46. $data[] = array
  47. (
  48. 'name' => '当日用户新增',
  49. 'num' => $today_user,
  50. 'href' => '#',
  51. );
  52. $data[] = array
  53. (
  54. 'name' => '用户总量',
  55. 'num' => $user,
  56. 'href' => '#',
  57. );
  58. $data[] = array
  59. (
  60. 'name' => '门店数',
  61. 'num' => $shop,
  62. 'href' => '#',
  63. );
  64. $data[] = array
  65. (
  66. 'name' => '仓库数/工厂数',
  67. 'num' => $store . ' / ' . $factory,
  68. 'href' => '#',
  69. );
  70. return $data;
  71. }
  72. }