OutResume.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class OutResume extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'brokerid' => 'int',
  10. 'name' => 'string',
  11. 'avatar' => 'string',
  12. 'mobile' => 'string',
  13. 'idcard' => 'string',
  14. 'gender' => 'tinyint',
  15. 'age' => 'int',
  16. 'jobintention' => 'string',
  17. 'address' => 'string',
  18. 'education' => 'string',
  19. 'createtime' => 'int',
  20. 'updatetime' => 'int',
  21. 'comment' => 'string',
  22. 'status' => 'int',
  23. 'confirm_status' => 'int',
  24. ];
  25. // 设置字段自动转换类型
  26. protected $type = [
  27. 'createtime' => 'timestamp:Y-m-d H:i:s',
  28. 'updatetime' => 'timestamp:Y-m-d H:i:s',
  29. ];
  30. static $status = [1 => '未跟进', 2 => '未面试', 3 => '面试通过', 4 => '面试未通过', 5 => '用户放弃', 6 => '已入职', 7 => '已离职'];
  31. static $gender = [1 => '男', 2 => '女'];
  32. static $confirm_status = [1 => '待核销', 2 => '核验通过', 3 => '核验失败'];
  33. public function getStatusTextAttr($value, $data)
  34. {
  35. return self::$status[$data['status']];
  36. }
  37. public function getConfirmStatusTextAttr($value, $data)
  38. {
  39. return self::$confirm_status[$data['confirm_status']];
  40. }
  41. public function getGenderTextAttr($value, $data)
  42. {
  43. return self::$gender[$data['gender']];
  44. }
  45. // 关联Worker
  46. public function broker()
  47. {
  48. return $this->hasOne(Broker::class, "id", "brokerid");
  49. }
  50. }