Skip to content
Snippets Groups Projects
Commit 3ec0cbf9 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #12072 TIME 0:10 fix get shippings if no attachments

parent d5e2477f
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,21 @@ class ShippingController
'where' => ['res_id_master = ?'],
'data' => [$args['resId']]
]);
$attachments = array_column($attachments, 'res_id');
$where = '(document_id = ? and document_type = ?)';
$data = [$args['resId'], 'resource'];
if (!empty($attachments)) {
$where .= ' or (document_id in (?) and document_type = ?)';
$data[] = $attachments;
$data[] = 'attachment';
}
$shippingsModel = ShippingModel::get([
'select' => ['*'],
'where' => ['(document_id = ? and document_type = ?) or (document_id in (?) and document_type = ?)'],
'data' => [$args['resId'], 'resource', $attachments, 'attachment']
'where' => [$where],
'data' => $data
]);
$shippings = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment