【发布时间】:2013-09-04 10:18:12
【问题描述】:
我确实有以下课程:
class BillProduct extends Eloquent {
protected $softDelete = true;
protected $guarded = array();
public static $rules = array();
protected $table = 't_billsproducts';
}
如果我尝试使用
$record = BillProduct::find($idProduct)
$record 将为空。
如果我从上面的类中删除protected $softDelete,$record 将包含数据...
数据库中没有软删除的列 - 我想知道这里发生了什么...
有什么想法吗? 谢谢
德克
【问题讨论】:
-
检查原始查询,afaik 它类似于
'where deleted_at is null,但表中的该列不存在,因此没有结果。 -
谢谢,NULL 是解决方案 - 我在所有“删除时间”中都有“0000-00-00 00:00:00”