1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace Manage\Plugin;
- use Dever;
- class Console
- {
- public function data()
- {
- if (Dever::load('manage/auth')->checkFunc('console.index', 'edit', '控制台数据概览')) {
- $where['start'] = Dever::maketime(date('Y-m-d 00:00:00'));
- $where['end'] = Dever::maketime(date('Y-m-d 23:59:59'));
- $where['status'] = '1,2,3,4,5,6';
- $today_sell_cash = Dever::db('shop/sell_order')->getCashNum($where);
- $today_sell_order = Dever::db('shop/sell_order')->getOrderNum($where);
- $where['status'] = '1,2,3,4,5,6';
- $today_buy_cash = Dever::db('shop/buy_order')->getCashNum($where);
- $today_buy_order = Dever::db('shop/buy_order')->getOrderNum($where);
- $today_user = Dever::db('passport/user')->total($where);
- $user = Dever::db('passport/user')->total();
- $shop = Dever::db('shop/info')->total();
- $factory = Dever::db('factory/info')->total();
- $store = Dever::db('store/info')->total();
- $total = 0;
- $data[] = array
- (
- 'name' => '当日销售额',
- 'num' => $today_sell_cash['total'] ? round($today_sell_cash['total'], 2) : 0,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '销售订单量',
- 'num' => $today_sell_order,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '采购额',
- 'num' => $today_buy_cash['total'] ? round($today_buy_cash['total'], 2) : 0,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '采购订单量',
- 'num' => $today_buy_order,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '当日用户新增',
- 'num' => $today_user,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '用户总量',
- 'num' => $user,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '门店数',
- 'num' => $shop,
- 'href' => '#',
- );
- $data[] = array
- (
- 'name' => '仓库数/工厂数',
- 'num' => $store . ' / ' . $factory,
- 'href' => '#',
- );
- return $data;
- } else {
- return array();
- }
- }
- }
|