增加 更多的字段

This commit is contained in:
iVampireSP.com 2022-12-18 18:14:07 +08:00
parent 2a07a3c045
commit 9d0b825071
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -23,7 +23,7 @@ public function index(Request $request): View
$hosts = Host::with('user');
// 遍历所有的搜索条件
foreach (['name', 'module_id', 'status', 'user_id'] as $field) {
foreach (['name', 'module_id', 'status', 'user_id', 'price', 'managed_price', 'created_at', 'updated_at'] as $field) {
if ($request->has($field)) {
$hosts->where($field, 'like', '%' . $request->input($field) . '%');
}