Commit 6839f33b by 王栋源

wdy

parent 65d350a1
...@@ -31,6 +31,9 @@ class OpProductAPI extends APIBase { ...@@ -31,6 +31,9 @@ class OpProductAPI extends APIBase {
case "getProductInterface"://获取产品接口信息 case "getProductInterface"://获取产品接口信息
opResult = await this.productSve.getProductInterface(pobj.actionBody); opResult = await this.productSve.getProductInterface(pobj.actionBody);
break; break;
case "getaliicProduce"://阿里工商获取产品信息
opResult = await this.productSve.getaliicProduce(pobj.actionBody);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -56,5 +56,27 @@ class ProductService extends ServiceBase { ...@@ -56,5 +56,27 @@ class ProductService extends ServiceBase {
return system.getResultSuccess(list); return system.getResultSuccess(list);
} }
async getaliicProduce(actionBody) {
console.log(actionBody);
var producesql = "";
if (actionBody.regType == "ali.companyreg") {
var area=actionBody.area||"";
producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.city
+ "%' AND pc.price_desc LIKE '%" + actionBody.area
+ "%' and pc.additions_desc LIKE '%" + actionBody.companyCategory + "%' ;"
}else{
producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.park
+ "%' AND pc.price_desc LIKE '%" + actionBody.productType + "%' ;"
}
console.log(producesql);
var produceinfo = await this.customQuery(producesql);
console.log(produceinfo);
if (produceinfo) {
actionBody.payCode = produceinfo[0].payCode;
actionBody.channelItemCode = produceinfo[0].channelItemCode;
}
console.log(actionBody);
return system.getResultSuccess(actionBody);
}
} }
module.exports = ProductService; module.exports = ProductService;
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