Commit 7420790e by 孙亚楠

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

parents db109566 e38e5500
......@@ -74,6 +74,9 @@ class ActionAPI extends APIBase {
case "pageEorderContract":// 合同列表(分页)
opResult = await this.eordersignlogSve.pageEorderContract(action_body);
break;
case "getMerchantLiveProduct":// 查询商户下可用订单的产品
opResult = await this.eorderSve.getMerchantLiveProduct(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -92,5 +92,18 @@ class EorderDao extends Dao{
return list ||[];
}
// 回去商户下订单中可用的产品
async getMerchantLiveProduct(merchantId) {
let sql = [];
sql.push("SELECT");
sql.push("t1.id, t1.`engine_account_id`, t2.product_id, t2.price, t1.`merchant_id`");
sql.push("FROM e_order t1");
sql.push("INNER JOIN `e_order_product` t2 ON t1.`id` = t2.`order_id`");
sql.push("WHERE t1.`merchant_id` = :merchantId");
sql.push("AND t1.`live_status` = '20' AND t1.`engine_account_id` <> ''");
sql.push("ORDER BY t1.`created_at` ASC");
return await this.customQuery(sql.join(" "), {merchantId: merchantId});
}
}
module.exports=EorderDao;
......@@ -428,5 +428,13 @@ class EorderService extends ServiceBase {
return system.getResult(null,`系统错误`);
}
}
async getMerchantLiveProduct(params) {
if (!params.merchant_id) {
return system.getResultSuccess([]);
}
let res = await this.dao.getMerchantLiveProduct(params.merchant_id);
return system.getResultSuccess(res);
}
}
module.exports = EorderService;
\ 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