You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 regels
691 B

  1. <?php
  2. namespace addons\unishop\model;
  3. use addons\unishop\extend\Hashids;
  4. use think\Model;
  5. class Ads extends Model
  6. {
  7. // 表名
  8. protected $name = 'unishop_ads';
  9. // 开启自动写入时间戳字段
  10. protected $autoWriteTimestamp = 'int';
  11. // 定义时间戳字段名
  12. protected $createTime = 'createtime';
  13. protected $updateTime = 'updatetime';
  14. /**
  15. * 处理图片
  16. * @param $value
  17. * @return string
  18. */
  19. public function getImageAttr($value) {
  20. return Config::getImagesFullUrl($value);
  21. }
  22. /**
  23. * 更改字段的值
  24. */
  25. public function getProductIdAttr($value) {
  26. return Hashids::encodeHex($value);
  27. }
  28. }