Commit 87382b23 by 宋毅

处理渠道退款

parent c7065bd9
const system = require("../../../system");
const Dao = require("../../dao.base");
const { Op } = require("sequelize");
const {Op} = require("sequelize");
class OrderInfoDao extends Dao {
constructor() {
super(Dao.getModelName(OrderInfoDao));
}
/**
* 更新订单
* @param status
* @param statusName
* @param channelOrderNo
* @param uapp_id
* @returns {Promise<*>}
*/
async updateStatus(status, statusName, channelOrderNo, uapp_id) {
let result = await this.updateByWhere({orderStatus: status, orderStatusName: statusName}, {
where: {
channelOrderNo: channelOrderNo,
uapp_id: uapp_id,
}
});
return result;
}
async getItemStatusByOrderNo(orderNo, uapp_id) {
var sqlWhere = {
where: {
......@@ -36,6 +56,7 @@ class OrderInfoDao extends Dao {
}
return await this.model.findOne(sqlWhere);
}
async getItemStatusByChannelOrderNo(channelOrderNo, uapp_id) {
var sqlWhere = {
where: {
......@@ -67,6 +88,7 @@ class OrderInfoDao extends Dao {
}
return await this.model.findOne(sqlWhere);
}
async delOrderByOrderNo(orderNo, uapp_id, channelUserId) {
var sqlWhere = {
orderNo: orderNo,
......@@ -82,6 +104,7 @@ class OrderInfoDao extends Dao {
};
return await this.delete(sqlWhere);
}
async channeldelOrder(channelOrderNo, uapp_id) {
var sqlWhere = {
channelOrderNo: channelOrderNo,
......@@ -89,6 +112,7 @@ class OrderInfoDao extends Dao {
};
return await this.delete(sqlWhere);
}
async addOrderDelivery(data, orderNo, t) {//新增交付信息
const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
......@@ -131,7 +155,7 @@ class OrderInfoDao extends Dao {
* @returns {Promise<Array<Model>|*>}
*/
async bulkUpdateStatus(status, statusName, ids) {
let result = await this.updateByWhere({ orderStatus: status, orderStatusName: statusName }, {
let result = await this.updateByWhere({orderStatus: status, orderStatusName: statusName}, {
where: {
channelOrderNo: {
[Op.in]: ids
......@@ -141,4 +165,5 @@ class OrderInfoDao extends Dao {
return result;
}
}
module.exports = OrderInfoDao;
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