EmployeeCard.php 596 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class EmployeeCard extends Model
  5. {
  6. public function getQrcodeAttr($value)
  7. {
  8. if(empty($value)) return $value;
  9. $domain = config('app.ali_oss_bindurl');
  10. return 'https://'.$domain.'/'.$value;
  11. }
  12. public function getHeadimgurlAttr($value)
  13. {
  14. if(empty($value)) return $value;
  15. $domain = config('app.ali_oss_bindurl');
  16. return 'https://'.$domain.'/'.$value;
  17. }
  18. public function employee()
  19. {
  20. return $this->belongsTo(Employee::class, 'employee_id')->bind(['uid']);
  21. }
  22. }