Files
x-server-mobile/backend/app/model/CompanyFeishuApp.php
T

48 lines
874 B
PHP
Raw Normal View History

<?php
namespace app\model;
use support\Model;
class CompanyFeishuApp extends Model
{
protected $table = 'company_feishu_apps';
protected $fillable = [
'company_id',
'system_id',
'name',
'tenant_key',
'app_id',
'app_secret',
'base_uri',
'callback_url',
'mobile_callback_url',
'status',
];
protected $casts = [
'company_id' => 'integer',
'system_id' => 'integer',
'status' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/**
* 获取启用的应用
*/
public function scopeActive($query)
{
return $query->where('status', 1);
}
/**
* 关联公司
*/
public function company()
{
return $this->belongsTo(Company::class, 'company_id');
}
}