3-9 模型时间戳+软删除
2018-05-08
模型时间戳:
<?php
namespace app\index\model;
use think\Model;
class User extends Model{
#autowritetimestamp表示创建与更新的时间戳都被打开
protected $autoWriteTimestamp = true;
// #createtime为false表示创建的时间戳被关闭
// protected $createTime = false;
// #updatetime为true表示更新时间戳被打开
// protected $updateTime = true;
// #创建数据的时候创建时间戳默认写入字段create_time中,当要自定义时:
// protected $createTime = '自定义创建时间字段名';
// #更新数据的时候更新时间戳默认写入字段update_time中,当要自定义时:
// protected $updateTime = '自定义更新时间字段名';
}
1
采集 1
举报
0/150
提交
取消

