Commit 995e0f6c by 宋毅

Merge branch 'center-app' of gitlab.gongsibao.com:jiangyong/zhichan into center-app

parents 8d123705 b3e03fd4
......@@ -34,6 +34,9 @@ class OpProductAPI extends APIBase {
case "getAppInterface"://获取应用接口信息
opResult = await this.productSve.getAppInterface(pobj, pobj.actionBody);
break;
case "getaliicProduce"://阿里工商获取产品信息
opResult = await this.productSve.getaliicProduce(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -61,5 +61,28 @@ class ProductService extends ServiceBase {
var list = await this.customQuery(sql);
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 '%" + 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;
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