Commit 3b4431e3 by 兰国旗

laolan

parent 2182080a
...@@ -242,20 +242,26 @@ class ProductService extends ServiceBase { ...@@ -242,20 +242,26 @@ class ProductService extends ServiceBase {
//2020-12-21 baidu reg copy todo //2020-12-21 baidu reg copy todo
async getRegProducePrice(actionBody){ async getRegProducePrice(actionBody){
console.log('actionBody---',actionBody) console.log('actionBody---',actionBody)
if(actionBody.pathCode){
var pathCode = actionBody.pathCode;
}else{
var itemCode = { var itemCode = {
item_code:actionBody.typeCode item_code:actionBody.typeCode
} }
var pathSql = "SELECT path_code FROM p_product WHERE item_code = :item_code"; var pathSql = "SELECT path_code,channel_item_code FROM p_product WHERE item_code = :item_code";
var pathCodeData = await this.customQuery(pathSql,itemCode); var pathCodeData = await this.customQuery(pathSql,itemCode);
if(actionBody.pathCode){
var pathCode = actionBody.pathCode;
}else{
if(pathCodeData){ if(pathCodeData){
var pathCode = pathCodeData[0].path_code; var pathCode = pathCodeData[0].path_code;
} }
} }
console.log('pathCode---',pathCode) console.log('pathCode---',pathCode)
let channelItemCode = actionBody.channelItemCode; if(actionBody.channelItemCode){
var channelItemCode = actionBody.channelItemCode;
}else{
if(pathCodeData){
var channelItemCode = pathCodeData[0].channel_item_code;
}
}
const code1 = pathCode.split('/')[1];//一级产品码 const code1 = pathCode.split('/')[1];//一级产品码
const code2 = pathCode.split('/')[2];//二级产品码 const code2 = pathCode.split('/')[2];//二级产品码
let channel_item_code = code2; let channel_item_code = code2;
...@@ -338,10 +344,10 @@ class ProductService extends ServiceBase { ...@@ -338,10 +344,10 @@ class ProductService extends ServiceBase {
if(code2 == "GSREG"){ if(code2 == "GSREG"){
if(actionBody.city && actionBody.taxpayerType ){ if(actionBody.city && actionBody.taxpayerType ){
let str = actionBody.city + actionBody.taxpayerType; let str = actionBody.city + actionBody.taxpayerType;
producesql += ` AND pc.price_desc LIKE '%${str}%'`; producesql += ` AND pc.price_desc = '${str}'`;
} }
if(actionBody.companyProperties){ if(actionBody.companyProperties){
producesql += ` AND pc.additions_desc LIKE '%${actionBody.companyProperties}%'`; producesql += ` AND pc.additions_desc = '${actionBody.companyProperties}'`;
}else{ }else{
return system.getResultFail(null,'actionBody.companyProperties and actionBody.companyProperties can not be empty!') return system.getResultFail(null,'actionBody.companyProperties and actionBody.companyProperties can not be empty!')
} }
......
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