fix

parent acd66326
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace common\modules\bids\controllers; namespace common\modules\bids\controllers;
use common\modules\bids\models\BidFile;
use Yii; use Yii;
use common\modules\bids\models\Bid; use common\modules\bids\models\Bid;
use common\modules\bids\models\SearchBid; use common\modules\bids\models\SearchBid;
...@@ -21,6 +22,7 @@ class BidAdminController extends AdminController ...@@ -21,6 +22,7 @@ class BidAdminController extends AdminController
'Update' => 'Редактирование заявки', 'Update' => 'Редактирование заявки',
'View' => 'Просмотр заявки', 'View' => 'Просмотр заявки',
'Delete' => 'Удаление заявки', 'Delete' => 'Удаление заявки',
'Download' => '',
]; ];
} }
...@@ -110,7 +112,13 @@ class BidAdminController extends AdminController ...@@ -110,7 +112,13 @@ class BidAdminController extends AdminController
public function actionDownload($file) public function actionDownload($file)
{ {
$model = BidFile::find()->where(['filename' => $file])->one();
if($model) {
return Yii::$app->response->sendFile(BidFile::path() . $model->filename, $model->filename);
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment