Commit 35495355 by 宋毅

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

parents 0ee57217 bc684391
...@@ -99,53 +99,73 @@ class ProductService extends ServiceBase { ...@@ -99,53 +99,73 @@ class ProductService extends ServiceBase {
* @returns {Promise<{msg: *, data, status: number}>} * @returns {Promise<{msg: *, data, status: number}>}
*/ */
async getProductPrice(actionBody){ async getProductPrice(actionBody){
let pathCode = actionBody.pathCode;
let channelItemCode = actionBody.channelItemCode; let channelItemCode = actionBody.channelItemCode;
const code1 = channelItemCode.split('/')[1] const code1 = pathCode.split('/')[1];//一级产品码
const code2 = channelItemCode.split('/')[2] const code2 = pathCode.split('/')[2];//二级产品码
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 is_show = 1 and pt.channel_item_code = '" +code2+"'"; let channel_item_code = code2;
//资质许可 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 is_show = 1 AND pt.channel_item_code = '${channelItemCode}'`;
if(code1 === 'zzxk'){ switch (code1) {
if(actionBody.province != ''){ case 'sbfu':
producesql += " AND pc.price_desc LIKE '%"+actionBody.province+"%'"; channel_item_code = channelItemCode;
}else{ break;
return system.getResultFail(null,'actionBody.province can not be empty!') case 'zzxk':
} if(actionBody.province != ''){
if(actionBody.time!= ''){ producesql += ` AND pc.price_desc LIKE '%${actionBody.province}%'`;
const index = actionBody.time.indexOf('个'); }else{
const time = actionBody.time.substring(0,index) return system.getResultFail(null,'actionBody.province can not be empty!')
producesql += " AND pc.additions_desc LIKE '%"+actionBody.time+"%'"; }
}else{ if(actionBody.time!= ''){
return system.getResultFail(null,'actionBody.time can not be empty!') const index = actionBody.time.indexOf('个');
} const time = actionBody.time.substring(0,index);
} producesql += ` AND pc.additions_desc LIKE '%${time}%'`;
//版权管理 }else{
if(code1 === 'bqfu'){ return system.getResultFail(null,'actionBody.time can not be empty!')
if(actionBody.serviceType != ''){ }
producesql += " AND pc.price_desc LIKE '%"+actionBody.serviceType+"%'"; break;
}else{ case 'bqfu':
return system.getResultFail(null,'actionBody.serviceType can not be empty!') if(actionBody.serviceType != ''){
} producesql += ` AND pc.price_desc LIKE '%${actionBody.serviceType}%'`;
if(actionBody.time!= ''){ }else{
const index = actionBody.time.indexOf('个'); return system.getResultFail(null,'actionBody.serviceType can not be empty!')
const time = actionBody.time.substring(0,index) }
producesql += " AND pc.additions_desc LIKE '%"+time+"%'"; if(actionBody.time!= ''){
}else{ const index = actionBody.time.indexOf('个');
return system.getResultFail(null,'actionBody.time can not be empty!') const time = actionBody.time.substring(0,index)
} producesql += ` AND pc.additions_desc LIKE '%${time}%'`;
} }else{
//工商服务 return system.getResultFail(null,'actionBody.time can not be empty!')
if(code1 === 'gsfu'){ }
if(actionBody.city != '' && actionBody.serviceType != ''){ break;
let str = actionBody.city + actionBody.serviceType; case 'gsfu':
producesql += " AND pc.price_desc LIKE '%"+str+"%'"; if(code2 != 'ysgszc'){
}else{ if(actionBody.city != '' && actionBody.serviceType != ''){
return system.getResultFail(null,'actionBody.serviceType can not be empty!') let str = actionBody.city + actionBody.serviceType;
} producesql += ` AND pc.price_desc LIKE '%${str}%'`;
if(actionBody.companyType != ''){ }else{
producesql += " AND pc.additions_desc LIKE '%"+actionBody.companyType+"%'"; return system.getResultFail(null,'actionBody.serviceType can not be empty!')
}else{ }
return system.getResultFail(null,'actionBody.taxType and actionBody.companyType can not be empty!') }else{
} let str = actionBody.city;
producesql += ` AND pc.price_desc LIKE '%${str}%'`;
}
if(actionBody.companyType != ''){
producesql += ` AND pc.additions_desc LIKE '%${actionBody.companyType}%'`;
}else{
return system.getResultFail(null,'actionBody.companyType and actionBody.companyType can not be empty!')
}
break;
case 'csdb':
if(actionBody.city != ''){
let str = actionBody.city;
producesql += ` AND pc.price_desc LIKE '%${str}%'`;
}else{
return system.getResultFail(null,'actionBody.serviceType can not be empty!')
}
break;
default:
producesql += ` AND pt.channel_item_code = '${code2}'`;
break;
} }
var produceinfo = await this.customQuery(producesql); var produceinfo = await this.customQuery(producesql);
if (produceinfo) { if (produceinfo) {
......
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