Commit 16492eba by 孙亚楠

md

parent a2290504
......@@ -8,6 +8,7 @@ module.exports = function (db, DataTypes) {
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
price: { type: DataTypes.BIGINT, field: 'price', allowNull: true, defaultValue:0,comment:'订单价格'},
product_name: {type: DataTypes.STRING, field: 'product_name', allowNull: true,defaultValue:'', comment:'产品名称'},
product_property: {type: DataTypes.INTEGER, field: 'product_property', allowNull: true,defaultValue:0, comment:'产品属性 1认证 2签约'},
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
......
......@@ -67,6 +67,9 @@ class EorderService extends ServiceBase {
if(!_orderBean){
return system.getResult(null, `订单【${params.id}】不存在`);
}
if(_orderBean.audit_status!='10'){
return system.getResult(null, `订单【${_orderBean.id}】不能编辑`);
}
let _orderBeanProperties={id:_orderBean.id};
_orderBeanProperties.merchant_id = params.merchant_id ? params.merchant_id : _orderBean.merchant_id;
_orderBeanProperties.merchant_name = params.merchant_name ? params.merchant_name : _orderBean.merchant_name;
......@@ -117,7 +120,8 @@ class EorderService extends ServiceBase {
order_id: _orderBean.id,
product_id: productItemMap[key].id,
product_name: productItemMap[key].product_name,
price: productItemMap[key].price
price: productItemMap[key].price,
product_property:productItemMap[key].product_property
});
}
_orderBeanProperties.eorderProducts=eorderProductProperties;
......@@ -144,7 +148,8 @@ class EorderService extends ServiceBase {
order_id: orderBean.id,
product_id: productItemMap[key].id,
product_name: productItemMap[key].product_name,
price: productItemMap[key].price
price: productItemMap[key].price,
product_property:productItemMap[key].product_property
});
}
await this.eorderproductDao.bulkCreate(eorderProductProperties,t);
......@@ -264,7 +269,7 @@ class EorderService extends ServiceBase {
},
attributes:['product_id','product_name','price','order_id']
});
orderBean.productChildren = productChildren;
orderBean.product_arr = productChildren;
this.handleDate(orderBean, ['created_at','pay_date','audit_date','live_start','live_end'], null, null);
orderBean.product_type_name = orderBean.product_type == '1' ? '单产品' : '组合产品';
......@@ -335,10 +340,10 @@ class EorderService extends ServiceBase {
if(!orderProductMap[childPro.order_id]){
orderProductMap[childPro.order_id] = [];
}
orderProductMap[childPro.order_id].push(childPro.product_id);
orderProductMap[childPro.order_id].push(childPro);
}
for(let element of list){
element.eorderproduct = orderProductMap[element.id] || [];
element.eorderproduct = orderProductMap[element.id] || {};
}
return system.getResult({count: countRes.eorderCount, rows: list});
}catch (e) {
......@@ -412,6 +417,9 @@ class EorderService extends ServiceBase {
if(params.trade_id){
orderBean.trade_id = this.trim(params.trade_id);
}
if(params.engine_account_id){
orderBean.engine_account_id = this.trim(params.engine_account_id);
}
try{
await orderBean.save();
return system.getResultSuccess();
......
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