Commit 22e1c231 by wuyang.zou

fix bug: Order Detail Main Product Options Code Not Save Mysql DB

parent e3950090
......@@ -384,7 +384,7 @@ bool PmsOrdersData::insertSubProductData(const QList<dishesObject*> sub_products
if( !MainProOptions.isEmpty() ) {
++availSubProNum;
QSqlQuery query(m_sqlDb);
query.prepare("INSERT INTO order_item_condiments(item_id, condiment_code , price, condimen_total , qty ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)");
query.prepare("INSERT INTO order_item_condiments(item_id, condiment_code , price, condimen_total , qty ) VALUES(?, ?, ?, ?, ?)");
query.addBindValue(ProInIdRef.toInt()); // --主商品自增编号
query.addBindValue(MainProOptions); // --子商品code
query.addBindValue(0); // --子商品价格
......@@ -394,7 +394,7 @@ bool PmsOrdersData::insertSubProductData(const QList<dishesObject*> sub_products
QLOG_ERROR()<<QString("[<<<<---PmsOrdersData::insertSubProductData:Insert ProInIdRef:%1 MainProOptions code:%2 Failed --->>>>]")
.arg(ProInIdRef).arg(MainProOptions)
<<query.lastError().text()<<QString::number(query.lastError().type());
QLOG_ERROR()<<QString("INSERT INTO order_item_condiments(item_id, condiment_code , price, condimen_total , qty ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)")
QLOG_ERROR()<<QString("INSERT INTO order_item_condiments(item_id, condiment_code , price, condimen_total , qty ) VALUES(%1, %2, %3, %4, %5)")
.arg(ProInIdRef.toInt()).arg(MainProOptions).arg(0).arg(0).arg(1);
} else {
SubProInIdRef = query.lastInsertId().toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment