- Modifiche a ProductInfo... Continua
This commit is contained in:
@@ -168,20 +168,6 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
as: 'product',
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'productinfos',
|
||||
localField: 'product.idProduct',
|
||||
foreignField: '_id',
|
||||
as: 'product.productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$product.productInfo',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'producers',
|
||||
@@ -358,20 +344,6 @@ module.exports.getTotalOrderById = async function (id) {
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'productinfos',
|
||||
localField: 'product.idProductInfo',
|
||||
foreignField: '_id',
|
||||
as: 'product.productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$product.productInfo',
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'producers',
|
||||
@@ -637,19 +609,6 @@ module.exports.GeneraCSVOrdineProdotti = async function () {
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'productinfos',
|
||||
localField: 'product.idProductInfo',
|
||||
foreignField: '_id',
|
||||
as: 'productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: {
|
||||
path: '$productInfo',
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'gasordines',
|
||||
@@ -682,8 +641,8 @@ module.exports.GeneraCSVOrdineProdotti = async function () {
|
||||
{
|
||||
$group: {
|
||||
_id: '$product._id',
|
||||
name: { $first: '$productInfo.name' },
|
||||
weight: { $first: '$productInfo.weight' },
|
||||
name: { $first: '$product.productInfo.name' },
|
||||
weight: { $first: '$product.productInfo.weight' },
|
||||
price_acquistato: { $first: '$product.price_acquistato' },
|
||||
totalQuantity: { $sum: { $add: ['$quantity', '$quantitypreordered'] } },
|
||||
totalPrice_acquistato: {
|
||||
|
||||
Reference in New Issue
Block a user