66b61eada4
- 创建 support/Db.php 和 support/Model.php - 在 bootstrap.php 中自动初始化数据库 - 移除 app/util/Db.php - 更新所有模型和控制器使用官方类 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
874 B
PHP
48 lines
874 B
PHP
<?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');
|
|
}
|
|
}
|