|
@@ -121,14 +121,9 @@ class GroupService extends CrudService {
|
|
|
*/
|
|
|
async getGroup({ order_id }) {
|
|
|
assert(order_id, '缺少订单信息');
|
|
|
- const order = await this.orderModel.findById(order_id, { group: 1, customer: 1 });
|
|
|
+ const order = await this.orderModel.findById(order_id, { group: 1 });
|
|
|
if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
|
|
|
- let group = _.get(order, 'group');
|
|
|
- if (!ObjectId.isValid(group)) {
|
|
|
- const customer = _.get(order, 'customer');
|
|
|
- const groupData = await this.model.findOne({ 'persons.customer': customer }, { _id: 1 }).sort({ 'meta.createdAt': -1 });
|
|
|
- group = _.get(groupData, '_id');
|
|
|
- }
|
|
|
+ const group = _.get(order, 'group');
|
|
|
return group;
|
|
|
}
|
|
|
|