OutRecruit.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class OutRecruit extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'title' => 'string',
  10. 'company_name' => 'string',
  11. 'num' => 'int',
  12. 'province' => 'string',
  13. 'city' => 'string',
  14. 'district' => 'string',
  15. 'address' => 'string',
  16. 'agegroup' => 'string',
  17. 'tags' => 'string',
  18. 'requirement' => 'string',
  19. 'comdetails' => 'string',
  20. 'picall' => 'string',
  21. 'salary' => 'string',
  22. 'telephone' => 'string',
  23. 'remark' => 'string',
  24. 'status' => 'tinyint',
  25. 'priority' => 'int',
  26. 'updatetime' => 'int',
  27. 'createtime' => 'int',
  28. 'volume' => 'int',
  29. 'worker_id' => 'int',
  30. 'agent_id' => 'int',
  31. 'market_content' => 'string',
  32. 'is_bargain' => 'int',
  33. ];
  34. // 设置字段自动转换类型
  35. protected $type = [
  36. 'tags' => 'json',
  37. 'picall' => 'json',
  38. 'updatetime' => 'timestamp:Y-m-d H:i:s',
  39. 'createtime' => 'timestamp:Y-m-d H:i:s',
  40. ];
  41. // 设置JSON数据返回数组
  42. protected $jsonAssoc = true;
  43. public function getStatusTextAttr($value, $data)
  44. {
  45. $status = [1 => '审核通过', 2 => '待审核', 3 => '审核不通过'];
  46. return $status[$data['status']];
  47. }
  48. }