Forum categories

Записки CotoДела

Мои записи, как типовые решения разных вопросов с Cotonti

webitproff
webitproff • 2026-03-16 11:20 #495

Меняем массово статус наличия товара, в экстраполях путем SQL-запроса.

 

Модуль маркет про (Cotonti)
Для обновления записей в таблице cot_market, где категория 'energy', а поле `fieldmrkt_product_status` пустое (пустая строка ''), используем следующий SQL-запрос:
 


UPDATE cot_market 
SET fieldmrkt_product_status = 'outofstock' 
WHERE fieldmrkt_cat = 'energy' 
 AND fieldmrkt_product_status = '';

 

дополнительно можно: 
 


UPDATE cot_market 
SET fieldmrkt_product_status = 'outofstock' 
WHERE fieldmrkt_cat = 'energy' 
 AND (fieldmrkt_product_status = '' OR fieldmrkt_product_status IS NULL);

 

но NULL у нас нет - это лишнее,и  просто для примера. 

🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.