Commit 173ed045 by 宋毅

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

parents 3a728563 a5c326da
......@@ -47,7 +47,7 @@ class PolicyinfoService extends ServiceBase {
}
async addPolicyByExcel(){
var workbook = xl.readFile("policy4.xls")
var workbook = xl.readFile("policy6.xls")
const sheetNames = workbook.SheetNames; // 返回 ['sheet1', 'sheet2']
const worksheet = workbook.Sheets[sheetNames[0]];
var dataa =xl.utils.sheet_to_json(worksheet);
......
......@@ -56,10 +56,14 @@ class PolicyneedService extends ServiceBase {
}
var sql ="select * from "+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "+
"from b_policy_need where uapp_id="+app.uapp_id+" and popularizeUserCode='"+user.channel_userid+"') as need "+
"from b_policy_need where uapp_id="+app.uapp_id+" and (popularizeUserCode='"+user.channel_userid+"' ";
if(user.channel_userid=="18611219500"){
sql=sql+" or popularizeUserCode is null or popularizeUserCode='' ";
}
sql=sql+" )) as need "+
"LEFT JOIN "+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"+
"policyDate,policyProvince,policyCity,policyContent from b_policy_info) as policy "+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "+
"on need.policy_id=policy.id where 1=1 ";
// var sql = "SELECT * from b_policy_need where popularizeUserCode='"+user.channel_userid+"' and uapp_id="+app.uapp_id;
if(obj.policyName){
......@@ -80,7 +84,11 @@ class PolicyneedService extends ServiceBase {
sql=sql+" order by need.id desc LIMIT " + pageSize + " OFFSET " + from + "";
console.log(sql);
var sqlCount = "SELECT count(1) as dataCount FROM b_policy_need where " +
" popularizeUserCode='"+user.channel_userid+"' and uapp_id="+app.uapp_id;
" uapp_id="+app.uapp_id+" and (popularizeUserCode='"+user.channel_userid+"'";
if(user.channel_userid=="18611219500"){
sqlCount=sqlCount+" or popularizeUserCode is null or popularizeUserCode='' ";
}
sqlCount = sqlCount + ")";
var tmpResult = await this.customQuery(sql,{});
var tmpResultCount = await this.customQuery(sqlCount,{});
// if (!tmpResult || tmpResult.length == 0) {
......
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