CompanyBrand.php 495 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class CompanyBrand extends Model
  5. {
  6. /**
  7. * LOGO地址修改器
  8. */
  9. public function getLogoAttr($value)
  10. {
  11. if (empty($value)) return $value;
  12. $ali_oss_bindurl = config('app.ali_oss_bindurl');
  13. $url = 'https://' . $ali_oss_bindurl . '/' . $value;
  14. return $url;
  15. }
  16. /**
  17. * 店面
  18. */
  19. public function shop()
  20. {
  21. return $this->hasMany(Company::class, 'company_brand');
  22. }
  23. }