|
@@ -129,6 +129,7 @@ class OrderService extends ShopService {
|
|
include: [
|
|
include: [
|
|
{ model: that.app.model.PaysConfig, attributes: [], as: 'pays_config' },
|
|
{ model: that.app.model.PaysConfig, attributes: [], as: 'pays_config' },
|
|
{ model: that.app.model.Users, as: 'users', attributes: [] },
|
|
{ model: that.app.model.Users, as: 'users', attributes: [] },
|
|
|
|
+ { model: that.app.model.Users, as: 'inviter', attributes: [] },
|
|
{ model: that.app.model.Payments, as: 'payments', attributes: [] },
|
|
{ model: that.app.model.Payments, as: 'payments', attributes: [] },
|
|
{
|
|
{
|
|
model: that.app.model.OrdersProducts, as: 'orders_products', attributes: {
|
|
model: that.app.model.OrdersProducts, as: 'orders_products', attributes: {
|
|
@@ -138,7 +139,8 @@ class OrderService extends ShopService {
|
|
],
|
|
],
|
|
attributes: [
|
|
attributes: [
|
|
[ seq.col('pays_config.pay_name'), 'pay_name' ],
|
|
[ seq.col('pays_config.pay_name'), 'pay_name' ],
|
|
- [ seq.col('users.nickname'), 'nickname' ],
|
|
|
|
|
|
+ [ seq.col('users.nickname'), 'userName' ],
|
|
|
|
+ [ seq.col('inviter.nickname'), 'inviterName' ],
|
|
[ seq.col('payments.total_fee'), 'total_fee' ],
|
|
[ seq.col('payments.total_fee'), 'total_fee' ],
|
|
'order_status', 'pay_sn', 'consignee', 'mobile', 'address',
|
|
'order_status', 'pay_sn', 'consignee', 'mobile', 'address',
|
|
'create_time', 'order_sn', 'order_amount', 'surplus_amout', 'user_remarks',
|
|
'create_time', 'order_sn', 'order_amount', 'surplus_amout', 'user_remarks',
|
|
@@ -156,9 +158,10 @@ class OrderService extends ShopService {
|
|
.toString() : '0.00';
|
|
.toString() : '0.00';
|
|
const goods = [];
|
|
const goods = [];
|
|
result2.orders_products.forEach(item => {
|
|
result2.orders_products.forEach(item => {
|
|
- goods.push(`${item.product_name}${item.volume > 0 ? item.volume + 'ml' : ''}\tx\t${item.product_count}`);
|
|
|
|
|
|
+ goods.push(`${item.product_name}${'【' + item.product_sn + '】'}${item.volume > 0 ? item.volume + 'ml' : ''}\tx\t${item.product_count}`);
|
|
});
|
|
});
|
|
result2.goods = goods.join('\n');
|
|
result2.goods = goods.join('\n');
|
|
|
|
+ result2.nickname = result2.inviterName ? result2.userName + '【邀请人:' + result2.inviterName + '】' : result2.userName;
|
|
return result2;
|
|
return result2;
|
|
}
|
|
}
|
|
|
|
|