@@ -15,7 +15,7 @@ class ProductService extends ServiceBase {
asyncgetProductList(actionBody,appInfo){
varsql="select * from v_product where uapp_id="+appInfo.uapp_id+" and path_code like '"+actionBody.pathCode+"%'";
if(actionBody.productName){
sql+=" and item_name like '%"+actionBody.productName+"%'"
sql="select * from v_product where uapp_id="+appInfo.uapp_id+" and item_name like '"+actionBody.productName+"%'";
}
varlist=awaitthis.customQuery(sql);
returnsystem.getResultSuccess(list);
...
...
@@ -202,5 +202,34 @@ class ProductService extends ServiceBase {
}
returnsystem.getResultSuccess(data);
}
/**
* 获取推荐产品列表
* @param pobj
* @returns {Promise<void>}
*/
asyncgetProductRecommend(actionBody,appInfo){
consttype=actionBody.type;
letsql=``;
letresult=''
if(type==1){
sql=`select DISTINCT(recommend_code) from p_company_recommend where company_name = '${actionBody.companyName}'`;
}
if(type==2){
sql=`select DISTINCT(recommend_code) from p_company_recommend where company_name = '${actionBody.companyName}' and product_code = '${actionBody.productCode}'`;
}
if(type==3){
sql=`select DISTINCT(recommend_code) from p_product_recommend where product_code = '${actionBody.productCode}'`;
}
result=awaitthis.customQuery(sql);
letcodes="";
result.forEach(item=>{
codes+="'"+item.recommend_code+"',";
})
codes=codes.substring(0,codes.length-1);
letproductSql=`select * from v_product where channel_item_code in (${codes}) and uapp_id = ${appInfo.uapp_id}`