|
@@ -13,14 +13,23 @@ class HerramientaInventarioController extends AuthController {
|
|
|
public function actionIndex() {
|
|
|
$id = trim($this->req->get("id", ""));
|
|
|
$buscar = trim($this->req->get("q", ""));
|
|
|
-
|
|
|
+ $herramienta = trim($this ->req->get("herramienta",""));
|
|
|
+ $cantidad = trim($this ->req->get("cantidad",""));
|
|
|
+ $inicio = trim($this->req->get("inicio", ""));
|
|
|
+ $fin = trim($this->req->get("fin", ""));
|
|
|
$query = $this->queryInicial;
|
|
|
|
|
|
if($id > 0) {
|
|
|
$query->andWhere(["id" => $id]);
|
|
|
}
|
|
|
|
|
|
+ if($herramienta){
|
|
|
+ $query->andWhere( ['idHerramienta'=>$herramienta]);
|
|
|
+ }
|
|
|
|
|
|
+ if($cantidad){
|
|
|
+ $query->andWhere( ['like', 'CAST(cantidad AS TEXT)', (string)$cantidad]);
|
|
|
+ }
|
|
|
if($buscar) {
|
|
|
|
|
|
$query->andWhere([
|
|
@@ -29,7 +38,10 @@ class HerramientaInventarioController extends AuthController {
|
|
|
]);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ if ($inicio !== "" && $fin !== "") {
|
|
|
+ $query->andWhere(['>=', '[[fechaIngreso]]', $inicio])
|
|
|
+ ->andWhere(['<=', '[[fechaIngreso]]', $fin]);
|
|
|
+ }
|
|
|
return new Respuesta($query, $this->limite, $this->pagina, $this->ordenar);
|
|
|
}
|
|
|
|