no message

This commit is contained in:
kuaifan
2023-03-18 11:03:04 +08:00
parent fcdb021279
commit 58ce8325d6
7 changed files with 46 additions and 10 deletions

View File

@@ -114,7 +114,11 @@ class DialogController extends AbstractController
if (count($list) < 20 && Base::judgeClientVersion("0.21.60")) {
$users = User::select(User::$basicField)
->where(function ($query) use ($key) {
$query->where("email", "like", "%{$key}%")->orWhere("nickname", "like", "%{$key}%");
if (str_contains($key, "@")) {
$query->where("email", "like", "%{$key}%");
} else {
$query->where("nickname", "like", "%{$key}%")->orWhere("pinyin", "like", "%{$key}%");
}
})->orderBy('userid')
->take(20 - count($list))
->get();