<?phpnamespaceapp\common\model;usethink\Model;usethink\Request;usethink\Db;usetraits\model\SoftDelete;classVisitExtendsModel{// use SoftDelete;// 开启自动写入时间戳字段protected$name='visit_log';protected$autoWriteTimestamp='int';// 定义时间戳字段名protected$createTime='createtime';protected$updateTime='updatetime';protected$deleteTime='deletetime';protected$append=[];protected$alias='u';publicfunctionuser(){return$this->belongsTo('User','uid','id',[],'LEFT')->bind(['username'=>'username']);}}