Commit acb6ff7f by 庄冰

阿里icp获取产品信息区分应用

parent f3ac6d91
...@@ -39,7 +39,7 @@ class OpProductAPI extends APIBase { ...@@ -39,7 +39,7 @@ class OpProductAPI extends APIBase {
opResult = await this.productSve.getaliicProduce(pobj.actionBody); opResult = await this.productSve.getaliicProduce(pobj.actionBody);
break; break;
case "getaliicpProduce"://阿里icp获取产品信息 case "getaliicpProduce"://阿里icp获取产品信息
opResult = await this.productSve.getaliicpProduce(pobj.actionBody); opResult = await this.productSve.getaliicpProduce(pobj.actionBody,pobj.appInfo);
break; break;
case "getProductTypeInfo"://阿里工商获取需求類型 case "getProductTypeInfo"://阿里工商获取需求類型
opResult = await this.producttypeSve.getProductTypeInfo(pobj.actionBody, pobj.appInfo); opResult = await this.producttypeSve.getProductTypeInfo(pobj.actionBody, pobj.appInfo);
...@@ -62,4 +62,4 @@ class OpProductAPI extends APIBase { ...@@ -62,4 +62,4 @@ class OpProductAPI extends APIBase {
} }
module.exports = OpProductAPI; module.exports = OpProductAPI;
\ No newline at end of file
...@@ -61,7 +61,7 @@ class ProductService extends ServiceBase { ...@@ -61,7 +61,7 @@ class ProductService extends ServiceBase {
} }
/** /**
* 获取应用接口信息 * 获取应用接口信息
* @param {*} actionBody * @param {*} actionBody
*/ */
async getAppInterface(pobj, actionBody) { async getAppInterface(pobj, actionBody) {
var sql = "select * from v_op_interface where is_enabled=1 and product_id is null and uapp_id=" + pobj.appInfo.uapp_id; var sql = "select * from v_op_interface where is_enabled=1 and product_id is null and uapp_id=" + pobj.appInfo.uapp_id;
...@@ -88,9 +88,13 @@ class ProductService extends ServiceBase { ...@@ -88,9 +88,13 @@ class ProductService extends ServiceBase {
return system.getResultSuccess(actionBody); return system.getResultSuccess(actionBody);
} }
async getaliicpProduce(actionBody) { async getaliicpProduce(actionBody,appInfo) {
var uapp_id = appInfo && appInfo.uapp_id?appInfo.uapp_id:"";
var producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode,pc.price price FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_code LIKE '%" + actionBody.typeCode var producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode,pc.price price FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_code LIKE '%" + actionBody.typeCode
+ "%' AND pc.price_desc='"+actionBody.province+"' "; + "%' AND pc.price_desc='"+actionBody.province+"' ";
if(uapp_id){
producesql = producesql+" and uapp_id="+uapp_id;
}
var produceinfo = await this.customQuery(producesql); var produceinfo = await this.customQuery(producesql);
if (produceinfo) { if (produceinfo) {
actionBody.payCode = produceinfo[0].payCode; actionBody.payCode = produceinfo[0].payCode;
......
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