diff --git a/gorm_models/product.go b/gorm_models/product.go index c8a4d48..a2060cc 100644 --- a/gorm_models/product.go +++ b/gorm_models/product.go @@ -112,7 +112,7 @@ func DeleteProducts(db *gorm.DB) error { "LEFT JOIN order_items oi ON p.id = oi.product_id " + "LEFT JOIN order_items op ON p.id = op.parent_id " + "LEFT JOIN wishlist wp ON p.id = wp.product_id " + - "WHERE oi.id IS NULL AND op.id IS NULL AND wp.id IS NULL AND product_id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1);" + "WHERE oi.id IS NULL AND op.id IS NULL AND wp.id IS NULL AND p.id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1);" db.WithContext(ctx).Exec(qb) db.WithContext(ctx).Exec("UPDATE product_flat set sku=concat(id,\"-ordered\"), status=0 where status=1 AND product_id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1)" ) db.WithContext(ctx).Exec("UPDATE products set sku=concat(id,\"-ordered\") WHERE id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1)")