Я изучаю CodeIgniter4, и я застрял при использовании функции findAll (), она говорит следующее: mysqli_sql_exception # 1054 Неизвестный столбец «cursos.deleted_at» в «где пункт»
<?php namespace App\Models;
use CodeIgniter\Model;
class Codigofacilito_model extends Model
{
protected $table = 'cursos';
protected $primaryKey = 'idCurso';
protected $returnType = 'array';
protected $useSoftDeletes = true;
protected $allowedFields = ['nombreCurso','videosCurso'];
protected $useTimestamps = false;
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
function __construct()
{
if (is_callable('parent::__construct')) {
parent::__construct();
}
}
function crearCurso($arr)
{
$this->insert
(array(
'nombreCurso' => $arr['nombre'],
'videosCurso' => $arr['videos']
)
);
}
}
Контроллер:
<?php namespace App\Controllers;
use App\Models\codigofacilito_model;
class Cursos extends BaseController{
function __construct(){
if (is_callable('parent::__construct')) {
parent::__construct();
}
helper('form');
}
function index(){
$modelo1=new Codigofacilito_model($db);
$data=$modelo1->findAll();
echo view('codigofacilito/headers');
echo view('cursos/cursos',$data);
}
}
Соединение правильное, и все имена таблиц и другие верны.