From: Alexander Smirnov Date: Wed, 2 Apr 2025 13:00:17 +0000 (+0300) Subject: [ERP-378] notOnlyApprovedAndCreatedIn1C001 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=0eeb29628c0e03ab89c68d9d487ce2e612fb3f6a;p=erp24_rep%2Fyii-erp24%2F.git [ERP-378] notOnlyApprovedAndCreatedIn1C001 --- diff --git a/erp24/controllers/BouquetController.php b/erp24/controllers/BouquetController.php index 1d73c585..2ce8b9a8 100644 --- a/erp24/controllers/BouquetController.php +++ b/erp24/controllers/BouquetController.php @@ -5,6 +5,7 @@ namespace app\controllers; use Exception; use Yii; use yii\db\Expression; +use yii\filters\AccessControl; use yii\helpers\ArrayHelper; use yii\helpers\Url; use yii\web\Controller; @@ -29,6 +30,9 @@ class BouquetController extends Controller $query = BouquetComposition::find() ->orderBy(['id' => SORT_DESC]) ->groupBy('bouquet_composition.id'); + if (!Yii::$app->user->can('notOnlyApprovedAndCreatedIn1C001')) { + $query->andWhere(['status' => 2]); + } BouquetComposition::applyFilters($query, $request);