UserAuth.php 692 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. class UserAuth extends BaseModel
  4. {
  5. public function user()
  6. {
  7. return $this->belongsTo('App\Models\User', 'user_id');
  8. }
  9. public function project()
  10. {
  11. return $this->belongsTo('App\Models\Project', 'project_id');
  12. }
  13. public function project_role()
  14. {
  15. return $this->belongsTo('App\Models\ProjectRole', 'project_role_id');
  16. }
  17. public function getActive($type)
  18. {
  19. if($type == 'label') {
  20. return $this['active'] == 1 ? '<span class="layui-badge layui-bg-blue">通过</span>' : '<span class="layui-badge layui-bg-orange">待审核</span>';
  21. }
  22. return $this['active'];
  23. }
  24. }