Неизвестный столбец ' adresses_facturation.suppression 'в «где предложение» < /p>
< /blockquote>
В моей базе данных у меня есть столбец с именем подавления типа DateTime. < /p>
Код: Выделить всё
public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->first();
}
< /code>
Моя модель: < /p>
class AdressesFacturationModel extends Model
{
protected $DBGroup = 'default';
protected $table = 'adresses_facturation'; //Nom de la table
protected $primaryKey = 'idFacturation'; //Clé primaire de la table
protected $useAutoIncrement = true;
protected $returnType = 'object'; // ou array ou object
protected $useSoftDeletes = true;
protected $allowedFields = [
'idFacturation',
'civilite',
'nom',
'prenom',
'entreprise',
'adresse',
'complement',
'postal',
'ville',
'telephone',
'email',
'idPays',
'defaut',
'utilisateurs_idUtilisateur'
];
protected $useTimestamps = true;
protected $createdField = 'creation';
protected $updatedField = 'modification';
protected $deletedField = 'suppression';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $dateFormat = 'datetime';
< /code>
На данный момент я сделал как код: < /p>
public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->get()->getRow();
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... nd-findall
Мобильная версия