This commit is contained in:
toom1996
2025-07-18 15:23:34 +08:00
parent 95b480b346
commit 7d619fb503
7 changed files with 276 additions and 22 deletions

View File

@ -56,15 +56,4 @@ class ArticlesController extends AbstractController
'message' => 'ok'
];
}
#[RequestMapping(path:'brand-search', methods: 'get')]
public function brandSearch(): array
{
$input = $this->request->input('brand');
$query = Model::query()->select(['name', 'cn_name', 'id'])->where('name', 'like', "%$input%")
->orWhere('cn_name', 'like', "%$input%")
->get()->toArray();
return ['code' => 0, 'msg' => 'ok', 'data' => $query];
}
}