Commit 4ad6faf6 by 王昆

gsb

parent fed88914
...@@ -44,6 +44,9 @@ class ActionAPI extends APIBase { ...@@ -44,6 +44,9 @@ class ActionAPI extends APIBase {
case "orderAdd": case "orderAdd":
opResult = await this.storderSve.saveOrder(action_body); opResult = await this.storderSve.saveOrder(action_body);
break; break;
case "orderInfo":
opResult = await this.storderSve.info(action_body);
break;
case "orderPay": case "orderPay":
opResult = await this.storderSve.pay(action_body); opResult = await this.storderSve.pay(action_body);
break; break;
......
...@@ -8,7 +8,7 @@ class StOrderItemDao extends Dao { ...@@ -8,7 +8,7 @@ class StOrderItemDao extends Dao {
if (!ids || ids.length == 0) { if (!ids || ids.length == 0) {
return []; return [];
} }
var sql = []; let sql = [];
sql.push("SELECT"); sql.push("SELECT");
sql.push(attrs || "*"); sql.push(attrs || "*");
sql.push("FROM"); sql.push("FROM");
...@@ -20,11 +20,11 @@ class StOrderItemDao extends Dao { ...@@ -20,11 +20,11 @@ class StOrderItemDao extends Dao {
} }
async mapByIds(ids, attrs) { async mapByIds(ids, attrs) {
var result = {}; let result = {};
if (!ids || ids.length == 0) { if (!ids || ids.length == 0) {
return result; return result;
} }
var list = await this.findListByIds(ids, attrs); let list = await this.findListByIds(ids, attrs);
if (!list || list.length == 0) { if (!list || list.length == 0) {
return result; return result;
} }
...@@ -48,7 +48,7 @@ class StOrderItemDao extends Dao { ...@@ -48,7 +48,7 @@ class StOrderItemDao extends Dao {
this.setCondition(sql, params); this.setCondition(sql, params);
var list = await this.customQuery(sql.join(" "), params); let list = await this.customQuery(sql.join(" "), params);
if (!list || list.length == 0) { if (!list || list.length == 0) {
return 0; return 0;
} }
...@@ -58,7 +58,7 @@ class StOrderItemDao extends Dao { ...@@ -58,7 +58,7 @@ class StOrderItemDao extends Dao {
async listByCondition(params) { async listByCondition(params) {
params.startRow = Number(params.startRow || 0); params.startRow = Number(params.startRow || 0);
params.pageSize = Number(params.pageSize || 10); params.pageSize = Number(params.pageSize || 10);
var sql = []; let sql = [];
sql.push("SELECT"); sql.push("SELECT");
sql.push(params.attrs || "*"); sql.push(params.attrs || "*");
sql.push("FROM"); sql.push("FROM");
...@@ -82,6 +82,9 @@ class StOrderItemDao extends Dao { ...@@ -82,6 +82,9 @@ class StOrderItemDao extends Dao {
if (params.saas_merchant_id) { if (params.saas_merchant_id) {
sql.push("AND saas_merchant_id = :saas_merchant_id"); sql.push("AND saas_merchant_id = :saas_merchant_id");
} }
if (params.order_id) {
sql.push("AND order_id = :order_id");
}
if (params.saas_merchant_ids) { if (params.saas_merchant_ids) {
sql.push("AND saas_merchant_id IN (:saas_merchant_ids)"); sql.push("AND saas_merchant_id IN (:saas_merchant_ids)");
} }
......
...@@ -37,6 +37,16 @@ class StOrderService extends ServiceBase { ...@@ -37,6 +37,16 @@ class StOrderService extends ServiceBase {
return system.getResultSuccess(page); return system.getResultSuccess(page);
} }
async info(params) {
let order = await this.dao.getById(params.id);
if(!order) {
return system.getResult(null, "订单不存在");
}
this.handleDate(order, ["created_at"], null);
this.dictionary.setRowName("ORDER", order, ["order_type", "acc_type", "trade_mode", "trade_status", "check_status"]);
return system.getResultSuccess(order);
}
// 保存打款信息 // 保存打款信息
async saveOrder(order) { async saveOrder(order) {
if (!order) { if (!order) {
......
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