|
@@ -26,7 +26,7 @@ class PayOrderService extends CrudService {
|
|
async beforeCreate(data) {
|
|
async beforeCreate(data) {
|
|
if (!_.get(data, 'order_no')) data.order_no = this.getOrderNo();
|
|
if (!_.get(data, 'order_no')) data.order_no = this.getOrderNo();
|
|
const { data: nd, next } = await this.checkSurplus(data);
|
|
const { data: nd, next } = await this.checkSurplus(data);
|
|
- if (!next) throw new BusinessError(0, '扣除余额成功');
|
|
|
|
|
|
+ if (!next) throw new BusinessError(0, '扣除余额成功', nd);
|
|
data = nd;
|
|
data = nd;
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
@@ -65,7 +65,7 @@ class PayOrderService extends CrudService {
|
|
relation.money = surplus - money;
|
|
relation.money = surplus - money;
|
|
await relation.save();
|
|
await relation.save();
|
|
// 前端生成报名数据
|
|
// 前端生成报名数据
|
|
- return { data, next: false };
|
|
|
|
|
|
+ return { data: billData, next: false };
|
|
} catch (error) {
|
|
} catch (error) {
|
|
// 抓取数据库创建和修改的异常,
|
|
// 抓取数据库创建和修改的异常,
|
|
// 如果 billData没有值,说明是创建消费记录时发生的错误,不需要做回滚处理;如果有值,那就删除
|
|
// 如果 billData没有值,说明是创建消费记录时发生的错误,不需要做回滚处理;如果有值,那就删除
|