Taggable.php 676 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace addons\cms\model;
  3. use think\Db;
  4. use think\Model;
  5. /**
  6. * 标签模型
  7. */
  8. class Taggable extends Model
  9. {
  10. protected $name = "cms_taggable";
  11. // 开启自动写入时间戳字段
  12. protected $autoWriteTimestamp = 'int';
  13. // 定义时间戳字段名
  14. protected $createTime = '';
  15. protected $updateTime = '';
  16. // 追加属性
  17. protected $append = [
  18. 'url',
  19. 'fullurl'
  20. ];
  21. protected static $config = [];
  22. protected static function init()
  23. {
  24. $config = get_addon_config('cms');
  25. self::$config = $config;
  26. }
  27. public function model()
  28. {
  29. return $this->belongsTo("Modelx");
  30. }
  31. }