mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando
This commit is contained in:
@ -8,6 +8,7 @@ use App\Services\LogisticaService;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Hermawan\DataTables\DataTable;
|
||||
|
||||
class LogisticaController extends BaseController
|
||||
{
|
||||
@ -69,16 +70,45 @@ class LogisticaController extends BaseController
|
||||
return view(static::$viewPath . 'viewLogisticaSelectEnvios', $viewData);
|
||||
}
|
||||
|
||||
public function searchPedidoOrISBN($search = ""){
|
||||
public function searchPedidoOrISBN($search = "")
|
||||
{
|
||||
|
||||
if(empty($search)){
|
||||
if (empty($search)) {
|
||||
$result = [
|
||||
'status' => false,
|
||||
'message' => lang('Logistica.errors.noDataToFind'),
|
||||
];
|
||||
return $this->response->setJSON($result);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
$result = LogisticaService::findPedidoOrISBN($search);
|
||||
return $this->response->setJSON($result);
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
public function datatable_envios()
|
||||
{
|
||||
$model = model('App\Models\Logistica\EnvioModel');
|
||||
$q = $model->getDatatableQuery();
|
||||
|
||||
|
||||
$result = DataTable::of($q)
|
||||
->edit(
|
||||
"finalizado",
|
||||
function ($row, $meta) {
|
||||
if ($row->finalizado == 1)
|
||||
return '<i class="ti ti-check"></i>';
|
||||
else
|
||||
return '<i class="ti ti-x"></i>';
|
||||
}
|
||||
)
|
||||
->add("action", callback: function ($q) {
|
||||
|
||||
return '
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||
</div>
|
||||
';
|
||||
});
|
||||
|
||||
return $result->toJson(returnAsObject: true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user