public function getOfertasDT($id) { $demandante = Demandante::find($id); $ofertas = $demandante->getOfertasComp(); $i = 0; $return = array(); foreach ($ofertas as $oferta) { $return[$i]['DT_RowId'] = 'row_' . $oferta->id; $return[$i]['compatibilidad'] = $demandante->getCompOferta($oferta) . '%'; $return[$i]['puesto'] = $oferta->puesto; $return[$i]['empresa'] = $oferta->empresa->nombre; $return[$i]['tipo_contrato'] = $oferta->tipo_contrato; $return[$i]['municipio'] = $oferta->municipio->NOMBRE; $return[$i]['created_at'] = DateSql::changeFromSql($oferta->created_at); $i++; if ($i >= 10) { break; } } $return = Sort::sortBy('compatibilidad', $return, 'desc'); $return['data'] = $return; $return['draw'] = Input::get('draw'); $return['recordsTotal'] = $i + 1; $return['recordsFiltered'] = $i + 1; return $return; }
protected function getInputDate($inputName, $defaultValue = "2018-12-20 00:00:00") { $defaultValue = \DateSql::changeFromSql($defaultValue); return '<input type="text" class="form-control datepicker" data-start-view="2" name="' . $inputName . '" id="' . self::generateInputId($inputName) . '" value="' . $defaultValue . '">'; }