Commit b42e4bee by 宋毅

tj

parent f30f40c4
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
const {Op} = require("sequelize"); const { Op } = require("sequelize");
class OrderInfoDao extends Dao { class OrderInfoDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(OrderInfoDao)); super(Dao.getModelName(OrderInfoDao));
...@@ -36,10 +36,10 @@ class OrderInfoDao extends Dao { ...@@ -36,10 +36,10 @@ class OrderInfoDao extends Dao {
} }
return await this.model.findOne(sqlWhere); return await this.model.findOne(sqlWhere);
} }
async getItemStatusByChannelOrderNo(orderNo, uapp_id) { async getItemStatusByChannelOrderNo(channelOrderNo, uapp_id) {
var sqlWhere = { var sqlWhere = {
where: { where: {
orderNo: orderNo channelOrderNo: orderNo
}, },
attributes: [ attributes: [
"id", "id",
...@@ -92,8 +92,8 @@ class OrderInfoDao extends Dao { ...@@ -92,8 +92,8 @@ class OrderInfoDao extends Dao {
async addOrderDelivery(data, orderNo, t) {//新增交付信息 async addOrderDelivery(data, orderNo, t) {//新增交付信息
const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" + const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')"; orderNo + "','" + JSON.stringify(data) + "')";
await this.customInsert(sql, null, t); await this.customInsert(sql, null, t);
return system.getResultSuccess() return system.getResultSuccess()
} }
/** /**
...@@ -101,11 +101,11 @@ class OrderInfoDao extends Dao { ...@@ -101,11 +101,11 @@ class OrderInfoDao extends Dao {
* @param ids * @param ids
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async getOrdersByIds(ids){ async getOrdersByIds(ids) {
let orders = await this.findAll({ let orders = await this.findAll({
where: { where: {
channelOrderNo: { channelOrderNo: {
[Op.in]:ids [Op.in]: ids
} }
} }
}) })
...@@ -117,10 +117,10 @@ class OrderInfoDao extends Dao { ...@@ -117,10 +117,10 @@ class OrderInfoDao extends Dao {
* @param needs * @param needs
* @returns {Promise<Array<Model>|*>} * @returns {Promise<Array<Model>|*>}
*/ */
async bulkUpdate(orders){ async bulkUpdate(orders) {
let result = await this.bulkCreate(orders,{ let result = await this.bulkCreate(orders, {
fields:["id", "status","statusName"] , fields: ["id", "status", "statusName"],
updateOnDuplicate: ["status","statusName"] updateOnDuplicate: ["status", "statusName"]
}); });
return result; return result;
} }
...@@ -130,11 +130,11 @@ class OrderInfoDao extends Dao { ...@@ -130,11 +130,11 @@ class OrderInfoDao extends Dao {
* @param needs * @param needs
* @returns {Promise<Array<Model>|*>} * @returns {Promise<Array<Model>|*>}
*/ */
async bulkUpdateStatus(status,statusName,ids){ async bulkUpdateStatus(status, statusName, ids) {
let result = await this.updateByWhere({orderStatus:status,orderStatusName:statusName},{ let result = await this.updateByWhere({ orderStatus: status, orderStatusName: statusName }, {
where : { where: {
channelOrderNo:{ channelOrderNo: {
[Op.in]:ids [Op.in]: ids
} }
} }
}); });
......
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