fchaose / qeephp

Automatically exported from code.google.com/p/qeephp
0 stars 0 forks source link

ar类中created字段bug #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
 若表中created字段是not null类型时,则在保存数据时无法通过验证类。
出错信息是: created:not null

若把created字段设置允许为null,则一切正常。

qeephp版本号:1168

Original issue reported on code.google.com by gaohem...@gmail.com on 18 Jun 2008 at 11:35

GoogleCodeExporter commented 8 years ago

Original comment by dualf...@gmail.com on 18 Jun 2008 at 5:50

GoogleCodeExporter commented 8 years ago
这里进行了调整,将原本由表数据入口负责的自动时间填充��
�为由 ActiveRecord 负责。

现在可以在 ActiveRecord 继承类的 create_autofill 和 update_autofill 
中指定是否使用当
前时间填充属性。

例如:

{{{
'create_autofill' => array
(
    'created' => self::AUTOFILL_TIMESTAMP,
    'updated' => self::AUTOFILL_TIMESTAMP,
),
}}}

AUTOFILL_TIMESTAMP 是当前时间的 UNIX TIMESTAMP 形式,AUTOFILL_DATETIME 
是当前时间的
ISO 8601 格式(例如:2004-02-12T15:19:21+00:00)。

Original comment by dualf...@gmail.com on 18 Jun 2008 at 7:00

GoogleCodeExporter commented 8 years ago
这次调整后又影响到非created型日期时间字段啦。
例如字段us_lastlogin 日期时间型 缺省可以为null。
当我不设置该字段时,保存时出错。出错信息如下:
us_lastlogin:最后登陆时间必须是一个有效的日期时间字符串。
qeephp svn : 1170.

出错代码如下请参考:
                $u2 = new user();
        $u2->us_uname = "abcttt";
        $u2->us_email = "u1@gmail.com";
        $u2->us_nickname = "asssbc111";
        $u2->us_regip = 1234;
        $u2->save();

Original comment by gaohem...@gmail.com on 19 Jun 2008 at 12:02