Node-RED mariadb setting

資訊庫元件設定

安裝【Manage Pallette】>>【Nodes】>> node-red-node-mysql

查詢待生產的訂單

msg.topic = “select concat(lastname, firstname) as ‘客戶名稱’, order_id as ‘訂單編號’, total as ‘金額’, date_added as ‘下單日期’ from oc_order where order_status_id =1”;

return msg;

var msg1 = {}

msg1.payload = msg.payload

msg1.topic = “select oc_order_product.name as ‘產品名稱’, oc_order_product.quantity as ‘數量’, oc_product_attribute.text as ‘蓋印次數’ \

            from oc_order_product \

            join oc_product_attribute on oc_order_product.product_id = oc_product_attribute.product_id \

            join oc_attribute_description on oc_product_attribute.attribute_id = oc_attribute_description.attribute_id \

            where oc_order_product.order_id = ” + msg.payload[“訂單編號”] + “”

return msg1;

加急

global.set(‘urgent_order_id’, msg.payload[“訂單編號”]);  

msg.topic = “select concat(lastname, firstname) as ‘客戶名稱’, order_id as ‘訂單編號’, total as ‘金額’, date_added as ‘下單日期’ from oc_order where order_status_id =17”;

return msg;

msg.topic = “select concat(lastname, firstname) as ‘客戶名稱’, order_id as ‘訂單編號’, total as ‘金額’, date_added as ‘下單日期’ from oc_order where order_status_id =17”;

return msg;

分類: Node-RED,標籤: 。這篇內容的永久連結

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *