From f95563ca36da65e121464324a9da3eafa50c2ff4 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Thu, 12 Dec 2019 16:54:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E5=A4=84=E7=90=86=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E4=BB=A3=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/shop/controllers/OrderController.php | 7 ++++++- backend/modules/shop/controllers/TakingSiteController.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/modules/shop/controllers/OrderController.php b/backend/modules/shop/controllers/OrderController.php index d18b007..166c69c 100755 --- a/backend/modules/shop/controllers/OrderController.php +++ b/backend/modules/shop/controllers/OrderController.php @@ -2,12 +2,15 @@ namespace backend\modules\shop\controllers; +use Throwable; use Yii; use backend\modules\shop\models\ars\Order; use backend\modules\shop\models\searchs\OrderSearch; +use yii\db\StaleObjectException; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use iron\widget\Excel; /** * OrderController implements the CRUD actions for Order model. @@ -102,6 +105,8 @@ class OrderController extends Controller * @param integer $id * @return mixed * @throws NotFoundHttpException if the model cannot be found + * @throws Throwable + * @throws StaleObjectException */ public function actionDelete($id) { @@ -138,7 +143,7 @@ class OrderController extends Controller } else { $dataProvider = $searchModel->search($params); } - \iron\widget\Excel::export([ + Excel::export([ 'models' => $dataProvider->getModels(), 'format' => 'Xlsx', 'asAttachment' => true, diff --git a/backend/modules/shop/controllers/TakingSiteController.php b/backend/modules/shop/controllers/TakingSiteController.php index b5daec9..9bfdd89 100755 --- a/backend/modules/shop/controllers/TakingSiteController.php +++ b/backend/modules/shop/controllers/TakingSiteController.php @@ -4,12 +4,15 @@ namespace backend\modules\shop\controllers; use backend\modules\shop\models\ars\Area; use backend\modules\shop\models\ars\City; +use Throwable; use Yii; use backend\modules\shop\models\ars\TakingSite; use backend\modules\shop\models\searchs\TakingSiteSearch; +use yii\db\StaleObjectException; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; +use iron\widget\Excel; /** * TakingSiteController implements the CRUD actions for TakingSite model. @@ -104,6 +107,8 @@ class TakingSiteController extends Controller * @param integer $id * @return mixed * @throws NotFoundHttpException if the model cannot be found + * @throws Throwable + * @throws StaleObjectException */ public function actionDelete($id) { @@ -140,7 +145,7 @@ class TakingSiteController extends Controller } else { $dataProvider = $searchModel->search($params); } - \iron\widget\Excel::export([ + Excel::export([ 'models' => $dataProvider->getModels(), 'format' => 'Xlsx', 'asAttachment' => true,