コード例 #1
0
ファイル: PlanHelper.php プロジェクト: johnny618/love
 /**
  * 获取配资已过周期
  * 
  */
 public static function getPastInterval($plan_type, $start_time, $end_time = null)
 {
     if (empty($end_time)) {
         $end_time = TimeHelper::zeroClockTimeOfDay(time());
     }
     $projectInfo = Project::getInfo($plan_type);
     if (!$projectInfo) {
         return false;
     }
     if ($projectInfo['type'] == Project::TYPE_DAY) {
         $rest_days = TimeHelper::get_real_day($start_time, $end_time);
         $rest_interval = $rest_days;
     } else {
         if ($projectInfo['type'] == Project::TYPE_MONTH) {
             $rest_days = TimeHelper::get_between_days($start_time, $end_time);
             $rest_interval = $rest_days % 30 == 0 ? $rest_days / 30 : intval($rest_days / 30) + 1;
         } else {
             return false;
         }
     }
     return $rest_interval;
 }