Commit e702cf52 by 孙亚楠

dd

parent 418fc42f
......@@ -80,7 +80,11 @@ class ActionAPI extends APIBase {
case "channelMapByIds":
opResult = await this.saaschannelSve.mapByIds(action_body);
break;
// 商户
case "queryMerchantByChannelId":
opResult = await this.saasmerchantSve.queryMerchantByChannelId(action_body);
break;
case "mchtIdsLikeName":
opResult = await this.saasmerchantSve.idsLikeName(action_body);
break;
......@@ -130,6 +134,9 @@ class ActionAPI extends APIBase {
case "addConsumeLog":
opResult = await this.saasmerchantconsumeSve.addLog(action_body);
break;
// ------------------------------以下api为历史将要弃用的---------------------------------------
// 商户api
// case "infoList":
......
......@@ -141,5 +141,22 @@ class SaasMerchantDao extends Dao {
sql.push("AND t1.created_at <= :createEnd");
}
}
/**
* fn:根据渠道ID查询商户ID
* @param params
* @returns {Promise<*>}
*/
async queryMerchantByChannelId(params){
var sql = [];
sql.push("SELECT");
sql.push("t1.*");
sql.push("FROM saas_merchant t1");
sql.push("WHERE 1 = 1 ");
this.setCondition(sql, params);
return await this.customQuery(sql.join(" "), params);
}
}
module.exports = SaasMerchantDao;
......@@ -405,5 +405,23 @@ class SaasMerchantService extends ServiceBase {
return system.getResult(null, `系统错误`);
}
}
/**
* fn:根据渠道ID查询所有的商户Id
* @param params
* @returns {Promise<void>}
*/
async queryMerchantByChannelId(params) {
if (!params.channel_id) {
return system.getResult(null, `参数错误 渠道ID 不能为空`);
}
try{
let ids =await this.dao.queryMerchantByChannelId(params);
return system.getResult(ids);
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = SaasMerchantService;
\ No newline at end of file
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