pengfuqiang96(提问者)var sql = \"select count(distinct office_name,model_name,category_name) totalCount from ProStateDetail where category_name in (\'\"+ts_pl+\"\')and category_model_state=\'\"+is_ts+\"\' \" + if(len(ts_xh)=0,\"and 1=1\",\"and model_name like \'%\"+ts_xh+\"%\' \");
var s = \'sql(\"SampleDashboard\",\"\' + sql + \'\",1,1)\';
var totalCount = FR.remoteEvaluate(s);
还是跑不出来
sql("SampleDashboard","select count(distinct office_name,model_name,category_name) totalCount from ProStateDetail
where "+if(len(ts_xh)=0,"1=1","model_name like '%"+xh+"% '")+
"and category_name in ('"+ts_pl+"') and category_model_state='"+is_ts+"' ",1,1)
sql("SampleDashboard","select count(distinct office_name,model_name,category_name) totalCount from ProStateDetail where 1=1 ${if(len(ts_xh)=0,'','model_name like "%'+ts_xh+'%" ')} and category_name in ('"+ts_pl+"') and category_model_state='"+is_ts+"' ",1,1)