mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
implement like method
This commit is contained in:
parent
42922cfb6b
commit
3edddbe8d0
1 changed files with 26 additions and 0 deletions
|
|
@ -126,4 +126,30 @@ class Auth
|
||||||
|
|
||||||
return $query->fetchAll();
|
return $query->fetchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function like(
|
||||||
|
string $request = '',
|
||||||
|
int $start = 0,
|
||||||
|
int $limit = 1000
|
||||||
|
): array
|
||||||
|
{
|
||||||
|
$query = $this->_connection->prepare(
|
||||||
|
sprintf(
|
||||||
|
'SELECT * FROM `auth`
|
||||||
|
WHERE `request` LIKE :request
|
||||||
|
ORDER BY `request` ASC
|
||||||
|
LIMIT %d,%d',
|
||||||
|
$start,
|
||||||
|
$limit
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$query->execute(
|
||||||
|
[
|
||||||
|
':request' => $request
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
return $query->fetchAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue