SELECT
prefix_grade_items.itemname AS Course,
prefix_grade_items.grademax,
ROUND(prefix_grade_grades_history.finalgrade, 0)
AS finalgrade,
prefix_user.firstname,
prefix_user.lastname,
prefix_user.username,
prefix_grade_grades_history.timemodified
FROM
prefix_grade_grades_history
INNER JOIN prefix_user ON prefix_grade_grades_history.userid = prefix_user.id
INNER JOIN prefix_grade_items ON prefix_grade_grades_history.itemid =
prefix_grade_items.id
WHERE (prefix_grade_items.itemname IS NOT NULL)
AND (prefix_grade_items.itemtype = 'mod' OR prefix_grade_items.itemtype = 'manual')
AND (prefix_grade_items.itemmodule = 'quiz' OR prefix_grade_items.itemmodule IS NULL)
AND (prefix_grade_grades_history.timemodified IS NOT NULL)
AND (prefix_grade_grades_history.finalgrade > 0)
AND (prefix_user.deleted = 0)
ORDER BY course
目前我正在尝试完善这个查询。我遇到的问题是使用 UNIX 命令将查询的时间从 timemodified 转换为 Human time。它出现在时代。我一直在尝试使用诸如 FROM_UNIXTIME(timestamp,'%a - %D %M %y %H:%i:%s') 之类的命令作为时间戳。作为参考,这是对 MariaDB 中包含的 moodle 服务器的临时查询。我期望的查询结果是,就我们得到的结果而言,没有任何变化,除了时间将采用月/日/年格式而不是当前格式。