thinkPHP distinct使用

单个用户多次提交考试   只查询一条
根据field 字段查询

$result = StuExam::distinct(true)->field('uid')->where($where)->order(['avg' => 'desc'])->limit(intval($num))
    ->select()
    ->map(function ($item) use ($uid, $data, $where) {});

猜你喜欢

转载自blog.csdn.net/qq_58778333/article/details/129877685