Model自动完成存在bug

浏览:356 发布日期:2016/02/25 分类:求助交流 关键字: bug
$_auto为: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时不更新数据。
最佳答案
评论() 相关
后面还有条评论,点击查看>>