OutRecruit.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. ];
  30. // 设置字段自动转换类型
  31. protected $type = [
  32. 'tags' => 'json',
  33. 'picall' => 'json',
  34. 'updatetime' => 'timestamp:Y-m-d H:i:s',
  35. 'createtime' => 'timestamp:Y-m-d H:i:s',
  36. ];
  37. // 设置JSON数据返回数组
  38. protected $jsonAssoc = true;
  39. public function getStatusTextAttr($value, $data)
  40. {
  41. $status = [1 => '上架', 2 => '下架'];
  42. return $status[$data['status']];
  43. }
  44. }