Medal.php 454 B

12345678910111213141516171819
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class Medal extends Model
  5. {
  6. public function employeeMedal(){
  7. return $this->hasOne(EmployeeMedal::class,'medal_id','id');
  8. }
  9. /**
  10. * 图片拼接
  11. */
  12. public function getPathAttr($value)
  13. {
  14. if (empty($value)) return $value;
  15. $ali_oss_bindurl = config('app.ali_oss_bindurl');
  16. $url = 'https://' . $ali_oss_bindurl . '/' . $value;
  17. return $url;
  18. }
  19. }