AuthorManuscript.php 619 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\admin\model\cms;
  3. use think\Model;
  4. class AuthorManuscript extends Model
  5. {
  6. // 表名
  7. protected $name = 'cms_author_manuscript';
  8. // 自动写入时间戳字段
  9. protected $autoWriteTimestamp = 'int';
  10. // 定义时间戳字段名
  11. protected $createTime = 'createtime';
  12. protected $updateTime = 'updatetime';
  13. public function typeList()
  14. {
  15. return ['reviewer' => __('Reviewer'), 'editor' => __('Editor')];
  16. }
  17. public function user()
  18. {
  19. return $this->belongsTo("\app\common\model\User", 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
  20. }
  21. }