Commit 65742cde by 王昆

Merge branch 'xggsve-order' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-order

parents 963197f7 ade317d5
......@@ -197,6 +197,9 @@ class ActionAPI extends APIBase {
case "saasorderbusinessmenPage": // 订单信息
opResult = await this.saasorderbusinessmenSve.saasorderbusinessmenPage(action_body);
break;
// case "queryBusinessmenByMerchantId": //根据商户ID,SAAS_ID查询所有的个体户
// opResult = await this.saasorderbusinessmenSve.queryBusinessmenByMerchantId(action_body);
// break;
case "assorderBusinessmenInfo": // 订单信息
opResult = await this.saasorderbusinessmenSve.assorderBusinessmenInfo(action_body);
break;
......
......@@ -72,6 +72,16 @@ class SaasorderbusinessmenDao extends Dao {
if (params.merchant_id) {
sql.push(`AND merchant_id = :merchant_id `);
}
if (params.merchant_id) {
sql.push(`AND merchant_id = :merchant_id `);
}
if (params.merchant_ids) {
sql.push(`AND merchant_id in (:merchant_ids) `);
}
if (params.saas_id) {
sql.push(`AND saas_id = :saas_id `);
}
}
......
......@@ -31,6 +31,12 @@ class SaasorderbusinessmenService extends ServiceBase {
if (params.legal_idcard) {
where.legal_idcard = this.trim(params.legal_idcard);
}
if (params.merchant_ids) {
where.merchant_ids = params.merchant_ids;
}
if (params.saas_id) {
where.saas_id = this.trim(params.saas_id);
}
params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10);
params.startRow = (params.currentPage - 1) * params.pageSize;
......@@ -43,7 +49,7 @@ class SaasorderbusinessmenService extends ServiceBase {
let res = await this.dao.saasorderbusinessmenPage(params);
for (let item of res) {
this.handleDate(item, ["created_at", "reg_date", "service_begin_time", "service_end_time", "sign_time","tax_reg_day"], "YYYY-MM-DD HH:mm:ss");
this.handleDate(item, ["created_at", "reg_date", "service_begin_time", "service_end_time", "sign_time", "tax_reg_day"], "YYYY-MM-DD HH:mm:ss");
item.is_bank_name = item.is_bank ? "已开户" : "未开户";
item.common_tax_ladder = JSON.parse(item.common_tax_ladder || "[]");
item.common_other_ladder = JSON.parse(item.common_other_ladder || "[]");
......@@ -62,25 +68,25 @@ class SaasorderbusinessmenService extends ServiceBase {
* @param params
* @returns {Promise<{msg: string, data: (*|null), bizmsg: string, status: number}>}
*/
async assorderBusinessmenInfo(params){
async assorderBusinessmenInfo(params) {
try {
let where = {};
if(params.merchant_app_user_id){
if (params.merchant_app_user_id) {
where.merchant_app_user_id = params.merchant_app_user_id;
}
if(params.merchant_id){
if (params.merchant_id) {
where.merchant_id = params.merchant_id;
}
if(params.name){
if (params.name) {
where.name = params.name;
}
let res = await this.dao.model.findAll({
where:where,
attributes:params.attrs
where: where,
attributes: params.attrs
});
return system.getResult(res || []);
}catch (e) {
} catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
......@@ -88,5 +94,4 @@ class SaasorderbusinessmenService extends ServiceBase {
}
module.exports = SaasorderbusinessmenService;
\ 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