zoukankan      html  css  js  c++  java
  • SugarCRM ListView查询中加入默认条件


    $_REQUEST['where'] = $where;
    $storeQuery->process_views($currentModule);
    上面加入以下代码,下面的代码指默认为查询本月
    if($where=='')
    {
     $date_period ='thismonth';
     
     $date_from = get_date_from($date_period);
     $date_to = get_date_to($date_period);

     if(isset($date_from) && $date_from != "") array_push($where_clauses, "ser_teenagers.date_modified>='$date_from'");
     if(isset($date_to) && $date_to != "") array_push($where_clauses, "ser_teenagers.date_modified<'$date_to'");
     
     $seedser_Teenager->custom_fields->setWhereClauses($where_clauses);
     
     $where = '';
     foreach($where_clauses as $clause){
      if($where != '')
       $where .= ' AND ';
      $where .= $clause;
     }
    }

  • 相关阅读:
    CTF SQL注入知识点
    Rot13加密算法
    LFU缓存
    Redability
    快排
    更新卡片的zIndex
    webshell文件下载器
    [转]背包九讲
    hihocoder第196周
    Python import容易犯的一个错误
  • 原文地址:https://www.cnblogs.com/hailexuexi/p/1998695.html
Copyright © 2011-2022 走看看