SearchLog.php 863 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace addons\cms\model;
  3. use think\Model;
  4. /**
  5. * 搜索日志模型
  6. */
  7. class SearchLog extends Model
  8. {
  9. protected $name = "cms_search_log";
  10. // 开启自动写入时间戳字段
  11. protected $autoWriteTimestamp = 'int';
  12. // 定义时间戳字段名
  13. protected $createTime = '';
  14. protected $updateTime = '';
  15. // 追加属性
  16. protected $append = [
  17. ];
  18. protected static $config = [];
  19. protected static function init()
  20. {
  21. static::$config = get_addon_config('cms');
  22. }
  23. public function getUrlAttr($value, $data)
  24. {
  25. return addon_url('cms/search/index', ['q' => $data['keywords']], static::$config['urlsuffix']);
  26. }
  27. public function getFullurlAttr($value, $data)
  28. {
  29. return addon_url('cms/search/index', ['q' => $data['keywords']], static::$config['urlsuffix'], true);
  30. }
  31. }