HuomaZima.php 570 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class HuomaZima extends Model
  5. {
  6. public function huoma_user()
  7. {
  8. return $this->hasMany(HuomaUser::class, 'bind_code','id');
  9. }
  10. public function company(){
  11. return $this->hasOne(Company::class, 'root_id','root_id');
  12. }
  13. /**
  14. * 图片拼接
  15. */
  16. public function getQrcodeImgAttr($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. }