protected $_auto = array(
array('reg_time', NOW_TIME, self::MODEL_INSERT),
array('status', 1, self::MODEL_INSERT),
);当执行$this->create()时,返回的数据中包括了字段reg_time,status的值array(
.
.
.
'reg_time'=>1456387867,
'status'=>1
)再执行$this->save();UPDATE `test` SET `leader`='5',`reg_time`='1456387867',`status`='1' WHERE `id` = 50也就是说这里的self::MODEL_INSERT在执行update操作时并不起作用,而且当设置为self::MODEL_UPDATE在update时不更新数据。 最佳答案