request->get(); $isMini = $get['isMini'] ?? 0; $notice = []; $admin = $this->admin; if ($isMini == 1 && !empty($admin)) { $miniOpenId = $admin['ghsMiniOpenId'] ?? ''; if (empty($miniOpenId)) { $notice = [['title' => '绑定微信,下次自动登录后台', 'action' => '去绑定', 'page' => '/admin/staff/miniAutoLogin']]; } } //今天销售 $sale = StatSaleClass::getByCondition(['mainId' => $this->mainId, 'time' => date('Ymd')]); $todaySale = $sale['amount'] ?? 0; $orderNum = $sale['num'] ?? 0; //2021.4.14 lqh 今日支出 $outData = StatOutService::getTodayNum($this->mainId); $todayOut = $outData['amount'] ?? '0.00'; //访客数 $visitCustom = StatVisitClass::getVisitNum($this->mainId); $todayData = ['income' => $todaySale, 'order' => $orderNum, 'expend' => $todayOut, 'visitCustom' => $visitCustom]; $incomeStat = []; $menu = [ ["name" => "商城", "img" => "ghs/home/shop.png", "url" => "/admin/home/mall"], ["name" => "改价", "img" => "ghs/home/gj.png", "url" => "/admin/changePrice/list"], ["name" => "花材", "img" => "ghs/home/hcgl.png", "url" => "/admin/item/list"], ["name" => "供应商", "img" => "ghs/home/icon_ghs.png", "url" => "/pagesPurchase/supplier"], ["name" => "采购单", "img" => "ghs/home/icon_caigou.png", "url" => "/pagesPurchase/order"], ["name" => "报损单", "img" => "ghs/home/kcyjs.png", "url" => "/admin/breakage/list"], ["name" => "预订单", "img" => "ghs/home/kcyjs.png", "url" => "/admin/order/statBook"], ["name" => "调拨出库", "img" => "ghs/home/dbck.png", "url" => "/pagesStorehouse/allot/allotEx"], ["name" => "调拨入库", "img" => "ghs/home/dbrk.png", "url" => "/pagesStorehouse/allot/allotPut"], ["name" => "员工", "img" => "ghs/home/yggl.png", "url" => "/admin/staff/list"], ["name" => "销售结账单", "img" => "ghs/home/kcyjs.png", "url" => "/admin/clear/customList"], ["name" => "采购结账单", "img" => "ghs/home/kcyjs.png", "url" => "/admin/clear/list"], ]; util::success(['asset' => $this->main, 'notice' => $notice, 'todayData' => $todayData, 'incomeStat' => $incomeStat, 'menu' => $menu,]); } //常用初始化 public function actionInit() { $dict = dict::get(); $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : []; util::success(['dict' => $dict, 'shop' => $shop]); } }