- creato editor di Pagine (iniziato)
- fix: mancano i "t," su alcuni componenti...
This commit is contained in:
@@ -495,36 +495,38 @@ class CronMod {
|
||||
await MyBot.generateBotMenuRecords(idapp);
|
||||
} else if (mydata.dbop === 'GenerateVapiKey') {
|
||||
await tools.generateVapiKey();
|
||||
} else if (mydata.dbop === 'convertProductInfos') {
|
||||
const products = await Product.find({ idProductInfo: { $exists: true } });
|
||||
console.log(
|
||||
'eseguiDbOpUser: convertProductInfos - TrovaticonvertProductInfos ',
|
||||
products.length,
|
||||
' prodotti con idProductInfo'
|
||||
);
|
||||
|
||||
/*} else if (mydata.dbop === 'visuNave') {
|
||||
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
|
||||
|
||||
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
|
||||
if (visu_nave_Bot)
|
||||
telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
|
||||
|
||||
ris = { mystr };
|
||||
} else if (mydata.dbop === 'getnavibyuser') {
|
||||
|
||||
let arrnavi = null;
|
||||
|
||||
const user = await User.getUserShortDataByUsername(idapp, mydata.username);
|
||||
if (user) {
|
||||
arrnavi = await Nave.getArrPosizioniByUsername(idapp, user.username);
|
||||
|
||||
for (let mynave of arrnavi) {
|
||||
mynave._doc.rec = await Nave.getNaveByRigaCol(idapp, mynave.riga, mynave.col);
|
||||
}
|
||||
|
||||
let aggiornati = 0;
|
||||
for (const product of products) {
|
||||
const productInfo = await ProductInfo.findById(product.idProductInfo);
|
||||
if (productInfo) {
|
||||
const productInfoObj = productInfo.toObject();
|
||||
delete productInfoObj._id;
|
||||
delete productInfoObj.__v;
|
||||
await Product.updateOne(
|
||||
{ _id: product._id },
|
||||
{
|
||||
$set: { productInfo: productInfoObj },
|
||||
$unset: { idProductInfo: 1 },
|
||||
}
|
||||
);
|
||||
|
||||
aggiornati++;
|
||||
|
||||
// ✅ Cancella il record ProductInfo ora che è stato copiato
|
||||
await ProductInfo.deleteOne({ _id: productInfo._id });
|
||||
}
|
||||
|
||||
ris = { data: arrnavi };
|
||||
|
||||
*/
|
||||
}
|
||||
console.log('eseguiDbOpUser - Aggiornati ', aggiornati, ' prodotti');
|
||||
}
|
||||
|
||||
// console.log('ris', ris);
|
||||
|
||||
return ris;
|
||||
} catch (e) {
|
||||
console.log(e.message);
|
||||
|
||||
Reference in New Issue
Block a user