Исправления
This commit is contained in:
parent
0a8c74a9a3
commit
85e3d5f1bd
|
@ -77,7 +77,7 @@ $config = [
|
||||||
'controller' => 'main'
|
'controller' => 'main'
|
||||||
],
|
],
|
||||||
'product/<catn:[^/]+>' => 'product/index',
|
'product/<catn:[^/]+>' => 'product/index',
|
||||||
'product/<catn:[^/]+>/<action:(write|edit|delete)>/<target:(title|catn|dscr|dmns|wght|image|cover)>' => 'product/<action>-<target>',
|
'<section:(product|cart)>/<catn:[^/]+>/<action:(write|edit|delete)>/<target:(title|catn|dscr|dmns|wght|image|cover|comm)>' => '<section>/<action>-<target>',
|
||||||
'orders' => 'order/index'
|
'orders' => 'order/index'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
@ -45,15 +45,22 @@ class OrderEdgeSupply extends Edge
|
||||||
* Поиск поставки по артикулу
|
* Поиск поставки по артикулу
|
||||||
*
|
*
|
||||||
* @param string $catn Артикул
|
* @param string $catn Артикул
|
||||||
|
* @param Order $order Заказ
|
||||||
* @param int $limit Максимальное количество
|
* @param int $limit Максимальное количество
|
||||||
*
|
*
|
||||||
* @return array Поставки
|
* @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 ($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();
|
return self::find()->where(['_to' => $supply->readId()])->limit($limit)->all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue