AgentPrize.php 517 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class AgentPrize extends Model
  5. {
  6. /**
  7. * 图片拼接
  8. */
  9. public function getImgAttr($value)
  10. {
  11. if (empty($value)) return $value;
  12. $domain = config('app.ali_oss_bindurl');
  13. $value = 'https://'.$domain.'/'.$value;
  14. return $value;
  15. }
  16. public function setImgAttr($value){
  17. $domain = config('app.ali_oss_bindurl');
  18. $search = 'https://'.$domain.'/';
  19. return str_replace($search, '', $value);
  20. }
  21. }