OutResume.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. ];
  24. // 设置字段自动转换类型
  25. protected $type = [
  26. 'createtime' => 'timestamp:Y-m-d H:i:s',
  27. 'updatetime' => 'timestamp:Y-m-d H:i:s',
  28. ];
  29. static $status = [1 => '未跟进', 2 => '未面试', 3 => '面试通过', 4 => '面试未通过', 5 => '用户放弃', 6 => '已入职', 7 => '已离职'];
  30. static $gender = [1 => '男', 2 => '女'];
  31. public function getStatusTextAttr($value, $data)
  32. {
  33. return self::$status[$data['status']];
  34. }
  35. public function getGenderTextAttr($value, $data)
  36. {
  37. return self::$gender[$data['gender']];
  38. }
  39. // 关联Worker
  40. public function broker()
  41. {
  42. return $this->hasOne(Broker::class, "id", "brokerid");
  43. }
  44. }