$id], [], $page, $size, function ($q) use ($keyword) { if (!empty($keyword)) { return $q::hasWhere('account', function ($q) use ($keyword) { $q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url"); }); } else { return $q->with(["account" => function ($query) { $query->field("nick_name,avatar_url"); }]); } }, ["id" => "desc"]); } }