|
@@ -194,7 +194,11 @@ class OrderService extends CrudService {
|
|
|
const head = _.head(data);
|
|
|
if (_.isString(head)) {
|
|
|
// 购物车来的,将购物车中的数据拿出来转换下
|
|
|
- const carts = await this.cartModel.find({ _id: data });
|
|
|
+ let carts = await this.cartModel.find({ _id: data });
|
|
|
+ if (carts.length > 0) {
|
|
|
+ carts = JSON.parse(JSON.stringify(data));
|
|
|
+ carts = data.map(i => ({ ...i, cart_id: i._id }));
|
|
|
+ }
|
|
|
data = carts;
|
|
|
}
|
|
|
const { result, msg } = await this.ctx.service.util.trade.checkCanBuy(data, false);
|