try yolo search to test api

This commit is contained in:
j3d1 2019-12-11 21:36:43 +01:00
parent d321093d0f
commit e66fcf3e88

View file

@ -26,7 +26,13 @@ class ItemController extends Controller
public function searchByEvent($event, $query)
{
return $this->showByEvent($event); //TODO actually search
$eid = Event::where('slug','=',$event)->first()->eid;
return response()->json(Item::where('eid','=',$eid)
->join('containers','items.cid','=','containers.cid')
->leftJoin('files','items.iid','=','files.iid')
->select('items.*','files.hash as file', 'containers.name as container')
->where('items.bezeichnung', 'like' , '%'.base64_decode ( $query , true).'%')
->get());
}
public function showOneItem($event, $id)