Huoma.php 679 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class Huoma extends Model
  5. {
  6. public function zima()
  7. {
  8. return $this->hasMany(HuomaZima::class, 'mid','id');
  9. }
  10. public function company(){
  11. return $this->hasOne(Company::class, 'root_id','root_id');
  12. }
  13. /**
  14. * 图片拼接
  15. */
  16. public function getPosterImgAttr($value)
  17. {
  18. if (empty($value)) return $value;
  19. $ali_oss_bindurl = config('app.ali_oss_bindurl');
  20. $url = 'http://' . $ali_oss_bindurl . '/' . $value;
  21. return $url;
  22. }
  23. public function employee(){
  24. return $this->hasOne(Employee::class, 'id','employee_id')->bind(['opt_name']);
  25. }
  26. }