The sql statement executed by
- is
//
//
let getOrder=(userId,orderType)=>{
let _sql=`select remark,goodsNumber,orderlist.goodsSize,goods.goodsName, goods.goodsImgArr from orderlist ,goods where userId="${userId}" and orderType="${orderType} and goods.goodsId = orderlist.goodsId ";`
return query(_sql,[]);
}
2.query method
/*query */
let query=(sql,values)=>{
return new Promise((resolve,reject)=>{
pool.getConnection((err,connection)=>{
if(err){
reject(err);
}else{
connection.query(sql,values,(err,rows)=>{
//
connection.release();
if(err){
reject(err);
}else{
resolve(rows);
}
});
};
});
});
}