Commit f78fd95b by 王昆

gsb

parent 7a491135
......@@ -89,7 +89,7 @@ class AccountService extends ServiceBase {
}
async trade(params) {
let accountId = params.account_id;
let accountId = Number(params.account_id);
let trade_no = this.trim(params.trade_no);
let trade_type = params.trade_type;
let trade_amt = Number(params.trade_amt || 0);
......@@ -120,12 +120,13 @@ class AccountService extends ServiceBase {
let res = await this.db.transaction(async t => {
//更新oorder订单记录
let bres = await this.dao.incrementBalance(accountId, balance_amt, t);
console.log(bres);
if (bres === 0) {
return system.getResult(null, "余额不足");
if (trade_amt != 0) {
let bres = await this.dao.incrementBalance(accountId, balance_amt, t);
console.log(bres);
if (bres === 0) {
return system.getResult(null, "余额不足");
}
}
//创建orderdeliver记录
let trade = await this.accounttradeDao.create({
account_id: accountId,
......
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