diff --git a/mirzaev/skillparts/system/config/web.php.example b/mirzaev/skillparts/system/config/web.php.example index 2fb375b..127b08e 100644 --- a/mirzaev/skillparts/system/config/web.php.example +++ b/mirzaev/skillparts/system/config/web.php.example @@ -77,7 +77,7 @@ $config = [ 'controller' => 'main' ], 'product/' => 'product/index', - 'product///' => 'product/-', + '///' => '
/-', 'orders' => 'order/index' ], ], diff --git a/mirzaev/skillparts/system/models/OrderEdgeSupply.php b/mirzaev/skillparts/system/models/OrderEdgeSupply.php index 0bd3b60..8521f56 100644 --- a/mirzaev/skillparts/system/models/OrderEdgeSupply.php +++ b/mirzaev/skillparts/system/models/OrderEdgeSupply.php @@ -45,15 +45,22 @@ class OrderEdgeSupply extends Edge * Поиск поставки по артикулу * * @param string $catn Артикул + * @param Order $order Заказ * @param int $limit Максимальное количество * * @return array Поставки */ - public static function searchBySupplyCatn(string $catn, int $limit = 10): array + public static function searchBySupplyCatn(string $catn, Order $order = null, int $limit = 10): array { if ($supply = Supply::searchByCatn($catn, 1)) { // Поставка найдена + if (isset($order)) { + // Поиск только по определённому заказу + + return self::find()->where(['_from' => $order->readId(), '_to' => $supply->readId()])->limit($limit)->all(); + } + return self::find()->where(['_to' => $supply->readId()])->limit($limit)->all(); }