新增traits方法

This commit is contained in:
wuyanwen 2020-01-13 21:24:12 +08:00
parent 3e0717c339
commit cffcf11192

View File

@ -75,4 +75,27 @@ trait BaseOptionsTrait
{
return static::onlyTrashed()->find($id)->restore();
}
/**
* 获取删除字段
*
* @time 2020年01月13日
* @return mixed
*/
public function getDeleteAtField()
{
return $this->deleteTime;
}
/**
* 别名
*
* @time 2020年01月13日
* @param $field
* @return string
*/
public function aliasField($field): string
{
return sprintf('%s.%s', $this->getTable(), $field);
}
}