Commit 478bc1a1 by 王昆

Merge branch 'xggsve-order' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order

parents a84941cc 1ae56b9d
...@@ -67,6 +67,7 @@ class OorderService extends ServiceBase { ...@@ -67,6 +67,7 @@ class OorderService extends ServiceBase {
order.contact_mobile = this.trim(params.contact_mobile); order.contact_mobile = this.trim(params.contact_mobile);
order.customer_name = this.trim(params.customer_name); order.customer_name = this.trim(params.customer_name);
order.saas_deliver_api = this.trim(params.saas_deliver_api); order.saas_deliver_api = this.trim(params.saas_deliver_api);
order.service_items = this.trim(params.service_items);
order.ali_deliver_api = this.trim(params.ali_deliver_api) || ""; order.ali_deliver_api = this.trim(params.ali_deliver_api) || "";
// 验证订单是否存在 // 验证订单是否存在
let exists = await this.dao.findOne({ source_id: order.source_id, source_no: order.source_no }); let exists = await this.dao.findOne({ source_id: order.source_id, source_no: order.source_no });
...@@ -462,7 +463,12 @@ class OorderService extends ServiceBase { ...@@ -462,7 +463,12 @@ class OorderService extends ServiceBase {
let productMap = await this.oproductDao.mapByIds(productIdList); let productMap = await this.oproductDao.mapByIds(productIdList);
for (let item of orderList) { for (let item of orderList) {
item.oproduct = productMap[item.product_id] || {} let _product = productMap[item.product_id] || {};
let oproduct = {};
for (let key in _product) {
oproduct[key] = _product[key];
}
item.oproduct = oproduct;
} }
let productAllMap = await this.oproductDao.findMapAll(); let productAllMap = await this.oproductDao.findMapAll();
...@@ -474,6 +480,9 @@ class OorderService extends ServiceBase { ...@@ -474,6 +480,9 @@ class OorderService extends ServiceBase {
for(let ele of item.service_items.split(',')){ for(let ele of item.service_items.split(',')){
childProductServiceItem += `${productAllMap[ele].name}、`; childProductServiceItem += `${productAllMap[ele].name}、`;
} }
if(childProductServiceItem.charAt(childProductServiceItem.length-1) == '、'){
childProductServiceItem = childProductServiceItem.substring(0, childProductServiceItem.length - 1)
}
item.oproduct.childProductServiceItem = childProductServiceItem || ""; item.oproduct.childProductServiceItem = childProductServiceItem || "";
} }
} }
......
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