public function actionIndex()
 {
     $searchModel = new UdashboardSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $countSaleorder = \backend\models\Saleorder::find()->count();
     $countInvoice = \backend\models\Saleorderinvoice::find()->count();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'salecount' => $countSaleorder, 'invoicecount' => $countInvoice]);
 }
 public function actionIndex()
 {
     $searchModel = new UdashboardSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $countSaleorder = \backend\models\Saleorder::find()->count();
     $countInvoice = \backend\models\Saleorderinvoice::find()->count();
     $lastSale = \backend\models\Saleorder::find()->orderBy('createdate DESC')->limit(10)->all();
     $lastInv = \backend\models\Saleorderinvoice::find()->orderBy('createdate DESC')->limit(10)->all();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'salecount' => $countSaleorder, 'invoicecount' => $countInvoice, 'lastsale' => $lastSale, 'lastinv' => $lastInv]);
 }