当前位置: 首页>>代码示例>>PHP>>正文


PHP date::then方法代码示例

本文整理汇总了PHP中date::then方法的典型用法代码示例。如果您正苦于以下问题:PHP date::then方法的具体用法?PHP date::then怎么用?PHP date::then使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在date的用法示例。


在下文中一共展示了date::then方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _build_datebox_sql

 private static function _build_datebox_sql($today, $today_arr, $then, $then_arr, $mark)
 {
     $t =& $GLOBALS["t"];
     $fields = explode(",", $GLOBALS["current_view"]["ENABLE_CALENDAR"]);
     if (count($fields) == 1) {
         self::$today = $today;
         self::$then = $then;
         $sql = "(" . $fields[0] . " between " . $today . " and " . $then . ")";
     } else {
         if (count($fields) == 2) {
             $sql = "((" . $fields[1] . " between " . $today . " and " . $then . ") or (" . $fields[0] . " between " . $today . " and " . $then . "))";
         } else {
             // 0-start,1-end,2-recurrence,3-until,4-allday,5-repeatinterval,6-repeatexclusions,7-repeatstart,8-repeatend
             $start = $fields[0];
             $end = $fields[1];
             $rec = $fields[2];
             $until = $fields[3];
             $rstart = $fields[7];
             $rend = $fields[8];
             $wtoday = $today_arr["wday"];
             $wthen = $then_arr["wday"];
             $mtoday = $today_arr["mday"];
             $mthen = $then_arr["mday"];
             $ytoday = $today_arr["yday"];
             $ythen = $then_arr["yday"];
             $sql = "(({$end} between {$today} and {$then}) or ({$then} between {$start} and {$end})";
             $sql .= " or ({$start} < {$then} and ({$until}=0 or {$until} > {$today}) and ";
             $sql .= "({$rec}='days'";
             if ($mark == "day") {
                 $sql .= " or ({$rec}='weeks' and (({$rend} between {$wtoday} and {$wthen}) or ({$rend}>={$rstart} and {$wthen} between {$rstart} and {$rend}) or ({$rend}<{$rstart} and {$wthen} not between {$rend}+1 and {$rstart}-1)) )";
             } else {
                 $sql .= " or {$rec}='weeks'";
             }
             if ($mark == "day" or $mark == "week") {
                 $sql .= " or ({$rec}='months' and (({$rend} between {$mtoday} and {$mthen}) or ({$rend}>={$rstart} and {$mthen} between {$rstart} and {$rend}) or ({$rend}<{$rstart} and {$mthen} not between {$rend}+1 and {$rstart}-1)) )";
             } else {
                 $sql .= " or {$rec}='months'";
             }
             if ($mark == "day" or $mark == "week" or $mark == "month" or $mark == "gantt") {
                 $sql .= " or ({$rec}='years' and (({$rend} between {$ytoday} and {$ythen}) or ({$rend}>={$rstart} and {$ythen} between {$rstart} and {$rend}) or ({$rend}<{$rstart} and {$ythen} not between {$rend}+1 and {$rstart}-1)) )";
             } else {
                 $sql .= " or {$rec}='years'";
             }
             $sql .= ")))";
         }
     }
     $t["sqlwhere"][] = $sql;
     $t["sqlwhere_default"][] = $sql;
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:49,代码来源:date.php


注:本文中的date::then方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。