request->isAjax()){ //顶部统计 $moneyLog = $moneyLog::getCountMonthBalance(); $panel=[ rand(100,1000), rand(100,1000), $moneyLog['balance'], // 当前结余(所有收入-支出) $shopDelivery::getPendingSettlementAmount(), //待结算金额 ]; $variety = []; $box = []; $material = []; $list = $stockConfig->where('status', $stockConfig::StatusNormal)->field('id,type_id,title')->orderRaw("field('variety_name','packing_box','material')")->select(); foreach ($list as $item) { switch ($item['type_id']) { case $stockConfig::VarietyName: $variety[] = [ 'name' => $item->title, 'num' => $stockDetail->where('key', $item['id'])->value('num') ]; break; case $stockConfig::PackingBox: $box[] = [ 'name' => $item->title, 'num' => $stockDetail->where('key', $item['id'])->value('num') ]; break; case $stockConfig::Material: $material[] = [ 'name' => $item->title, 'num' => $stockDetail->where('key', $item['id'])->value('num') ]; break; } } $this->success('',compact('panel','variety','box','material')); } return $this->fetch(); } #[Route('GET','dashboard/platform1')] public function platform1() { return $this->fetch(); } #[Route('GET','dashboard/platform2')] public function platform2() { return $this->fetch(); } }