Commit 29d42f5a by zhaoxiqing

gsb

parent 5907edc1
......@@ -24,6 +24,13 @@ class MerchantaccountService extends ServiceBase {
} else if (0 > params.amount) {
return system.getResultFail(-1, "交易金额错误");
}
var amount = await this.dao.findOne({merchant_id: params.merchant_id});
if (!amount) {
return system.getResultFail("-1", "请先充值");
}
var data = await this.dao.addordelmerchantrmb(params);
return system.getResultSuccess(data);
} catch (e) {
......@@ -40,8 +47,13 @@ class MerchantaccountService extends ServiceBase {
if (!params.amount) {
return system.getResultFail(-1, "请提供金额");
}
var amount = await this.dao.findOne({merchant_id: params.merchant_id});
if (!amount) {
return system.getResultFail("-1", "请先充值");
}
if (0 > params.amount) {
var amount = await this.dao.findOne({merchant_id: params.merchant_id});
let toam = Math.abs(params.amount);
if (0 > (amount.available_amount - toam)) {
return system.getResultFail(-1, "可用余额不足");
......
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