Commit 797adeef by 王昆

gsb

parent 73feaf38
...@@ -6,6 +6,23 @@ class MerchantapiDao extends Dao { ...@@ -6,6 +6,23 @@ class MerchantapiDao extends Dao {
super(Dao.getModelName(MerchantapiDao)); super(Dao.getModelName(MerchantapiDao));
} }
async infoById(id) {
let sql = [];
sql.push("SELECT");
sql.push("t1.*,");
sql.push("t2.`name` AS merchant_name");
sql.push("FROM `e_merchant_api` t1");
sql.push("INNER JOIN `e_merchant` t2 ON t1.`merchant_id` = t2.`id`");
sql.push("WHERE t1.id = :id");
sql.push("LIMIT 1");
let list = await this.customQuery(sql.join(" "), {id: id});
if (!list || list.length == 0) {
return null;
}
return list[0];
}
} }
module.exports = MerchantapiDao; module.exports = MerchantapiDao;
......
...@@ -7,7 +7,7 @@ class merchantapiService extends ServiceBase { ...@@ -7,7 +7,7 @@ class merchantapiService extends ServiceBase {
} }
async infoById(params) { async infoById(params) {
let info = await this.dao.getById(params.id); let info = await this.dao.infoById(params.id);
return system.getResultSuccess(info); return system.getResultSuccess(info);
} }
} }
......
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