Commit d553db73 by 孙亚楠

Merge branch 'esign-sve-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into esign-sve-merchant

parents 33053d1a 797adeef
......@@ -6,6 +6,23 @@ class MerchantapiDao extends Dao {
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;
......
......@@ -98,7 +98,7 @@ class MerchantService extends ServiceBase {
}
this.addWhereTime(where, 'created_at', params.beginTime, params.entTime, true);
var orderby = [["id", 'desc']];
var attributes = [`id`, `name`, `credit_code`, `contact_man`, `contact_mobile`, `contact_email`, `account_name`, `audit_status`];
var attributes = [`id`, `name`, `credit_code`, `contact_man`, `contact_mobile`, `contact_email`, `account_name`, `audit_status`, `bd_id`];
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
return system.getResultSuccess(page);
} catch (e) {
......@@ -112,7 +112,7 @@ class MerchantService extends ServiceBase {
if (!params.id) {
return system.getResultFail(-1, "商户ID为空");
}
var merchant = await this.dao.findById(params.id) || {};
var merchant = await this.dao.getById(params.id) || {};
return system.getResultSuccess(merchant);
} catch (e) {
console.log(e);
......
......@@ -7,7 +7,7 @@ class merchantapiService extends ServiceBase {
}
async infoById(params) {
let info = await this.dao.getById(params.id);
let info = await this.dao.infoById(params.id);
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