升级到31版本、修改学生成绩筛选

This commit is contained in:
巴掌 committed 2018-12-11 10:59:15 +08:00
1 parent a79e7bf237
commit d8ec4fad39
34 files changed
+447 -114

No files matched your search

@@ -11,6 +11,8 @@
namespace think\model\concern;
use DateTime;
/**
* 自动时间戳
*/
@@ -43,24 +45,31 @@ trait TimeStamp
/**
* 时间日期字段格式化处理
* @access protected
* @param mixed $time 时间日期表达式
* @param mixed $format 日期格式
* @param mixed $time 时间日期表达式
* @param bool $timestamp 是否进行时间戳转换
* @return mixed
*/
protected function formatDateTime($time, $format, $timestamp = false)
protected function formatDateTime($format, $time = 'now', $timestamp = false)
{
if (empty($time)) {
return;
}
if (false !== strpos($format, '\\')) {
$time = new $format($time);
} elseif (!$timestamp && false !== $format) {
$time = date($format, $time);
if (false === $format) {
return $time;
} elseif (false !== strpos($format, '\\')) {
return new $format($time);
}
return $time;
if ($timestamp) {
$dateTime = new DateTime();
$dateTime->setTimestamp($time);
} else {
$dateTime = new DateTime($time);
}
return $dateTime->format($format);
}
/**