WorkSubinfo.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\bug\model;
  3. use think\model\concern\SoftDelete;
  4. class WorkSubinfo extends Base
  5. { use SoftDelete;
  6. //设置字段信息
  7. protected $schema = [
  8. 'id' =>'bigint',//
  9. 'sub_id' =>'int',//岗位申请id
  10. 'content' =>'text',//功能内容
  11. 'action_id' =>'int',//功能id
  12. 'type' =>'tinyint',//类型 1添加2删除
  13. 'status' =>'tinyint',//状态 0待审批 1同意2驳回
  14. 'remark' =>'varchar',//
  15. 'createTime' =>'datetime',//
  16. 'updateTime' =>'datetime',//
  17. 'delete_time' =>'datetime',//
  18. ];
  19. protected $updateTime='updateTime';
  20. protected $createTime='createTime';
  21. protected $deleteTime = 'delete_time';
  22. public function WorkSub(){
  23. return $this->belongsTo(WorkSubscr::class,"sub_id","id");
  24. }
  25. public function SetContentAttr($v){
  26. return json_encode($v,JSON_UNESCAPED_UNICODE);
  27. }
  28. public function GetContentAttr($v){
  29. return json_decode($v,true);
  30. }
  31. }