1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Models;
- class UserAuth extends BaseModel
- {
- public function user()
- {
- return $this->belongsTo('App\Models\User', 'user_id');
- }
- public function project()
- {
- return $this->belongsTo('App\Models\Project', 'project_id');
- }
- public function project_role()
- {
- return $this->belongsTo('App\Models\ProjectRole', 'project_role_id');
- }
- public function getActive($type)
- {
- if($type == 'label') {
- return $this['active'] == 1 ? '<span class="layui-badge layui-bg-blue">通过</span>' : '<span class="layui-badge layui-bg-orange">待审核</span>';
- }
- return $this['active'];
- }
- }
|