8d78e18267
- Frontend: React 18 + TypeScript + Vite + Ant Design Mobile - Backend: PHP 8.5 + Webman 2.x + MySQL + Redis - i18n support: Chinese, English, Russian, Spanish, French - Approval workflow engine - Docker development environment - Feishu integration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
982 B
PHP
53 lines
982 B
PHP
<?php
|
|
|
|
namespace App\Model;
|
|
|
|
use support\Model;
|
|
|
|
class Company extends Model
|
|
{
|
|
protected $table = 'company';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'feishu_app_id',
|
|
'feishu_app_secret',
|
|
'feishu_tenant_key',
|
|
'status',
|
|
];
|
|
|
|
protected $casts = [
|
|
'status' => 'integer',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'feishu_app_secret',
|
|
];
|
|
|
|
/**
|
|
* 获取启用的公司
|
|
*/
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('status', 1);
|
|
}
|
|
|
|
/**
|
|
* 根据飞书租户Key查找
|
|
*/
|
|
public function scopeByFeishuTenantKey($query, string $tenantKey)
|
|
{
|
|
return $query->where('feishu_tenant_key', $tenantKey);
|
|
}
|
|
|
|
/**
|
|
* 根据飞书AppID查找
|
|
*/
|
|
public function scopeByFeishuAppId($query, string $appId)
|
|
{
|
|
return $query->where('feishu_app_id', $appId);
|
|
}
|
|
}
|