Commit 97f621a6 by 王昆

gsb

parent a6560128
const system = require("../../../system");
const Dao = require("../../dao.base");
class OorderprocessDao extends Dao {
constructor() {
super(Dao.getModelName(OorderprocessDao));
}
async mapByOrderIdsAndStatus(orderIds, statuses) {
async findByOrderIdAndStatus(orderId, status) {
if (!orderId || !status) {
return null;
}
let sql = [];
sql.push("SELECT");
sql.push("*");
sql.push("FROM `o_order_process`");
sql.push("WHERE order_id = :orderId");
sql.push("AND `status` = :status");
let list = await this.customQuery(sql.join(" "), {orderId: orderId, status: status});
if (!list || list.length == 0) {
return null;
}
return list[0];
}
async listByOrderIdsAndStatus(orderIds, statuses) {
var result = {};
if(!orderIds || orderIds.length == 0 || !statuses || statuses.length == 0) {
if (!orderIds || orderIds.length == 0 || !statuses || statuses.length == 0) {
return result;
}
let sql = [];
......@@ -17,8 +36,12 @@ class OorderprocessDao extends Dao {
sql.push("WHERE order_id IN (:orderIds)");
sql.push("AND `status` IN (:statuses)");
let list = await this.customQuery(sql.join(" "), {orderIds: orderIds, statuses: statuses});
return await this.customQuery(sql.join(" "), {orderIds: orderIds, statuses: statuses});
}
async mapByOrderIdsAndStatus(orderIds, statuses) {
var result = {};
let list = await this.listByOrderIdsAndStatus(orderIds, statuses);
if (!list || list.length == 0) {
return result;
}
......@@ -29,4 +52,5 @@ class OorderprocessDao extends Dao {
return result;
}
}
module.exports = OorderprocessDao;
......@@ -369,7 +369,7 @@ class OorderService extends ServiceBase {
* @deliver_id String 交付商ID
* @deliver_name String 交付商名称
* @deliver_deliver String 交付商分成
* @status String 下一个状态码
* @status String 下一个状态码
*/
async assignDeliver(params) {
//参数验证
......@@ -409,7 +409,7 @@ class OorderService extends ServiceBase {
}
}
}
......
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