|
|
@@ -1926,4 +1926,28 @@ class User extends BaseController
|
|
1926
|
1926
|
}
|
|
1927
|
1927
|
return app('json')->fail('设置失败');
|
|
1928
|
1928
|
}
|
|
|
1929
|
+
|
|
|
1930
|
+ /**
|
|
|
1931
|
+ * @return mixed
|
|
|
1932
|
+ * @throws DataNotFoundException
|
|
|
1933
|
+ * @throws DbException
|
|
|
1934
|
+ * @throws ModelNotFoundException
|
|
|
1935
|
+ */
|
|
|
1936
|
+ public function getUserListByFuzzy()
|
|
|
1937
|
+ {
|
|
|
1938
|
+ $fuzzy = request()->param('fuzzy', null);
|
|
|
1939
|
+ if (is_null($fuzzy)) {
|
|
|
1940
|
+ return app('json')->success('查询成功', []);
|
|
|
1941
|
+ }
|
|
|
1942
|
+ $userData = Db::name('user')
|
|
|
1943
|
+ ->where('is_del', '=', 0)
|
|
|
1944
|
+ ->where(function ($query) use ($fuzzy) {
|
|
|
1945
|
+ $query->where('nickname', 'like', '%' . $fuzzy . '%')
|
|
|
1946
|
+ ->whereOr('account', 'like', '%' . $fuzzy . '%');
|
|
|
1947
|
+ })
|
|
|
1948
|
+ ->field('uid, nickname, account')
|
|
|
1949
|
+ ->select()
|
|
|
1950
|
+ ->toArray();
|
|
|
1951
|
+ return app('json')->success('查询成功', $userData);
|
|
|
1952
|
+ }
|
|
1929
|
1953
|
}
|