8629f4a4ce
- Rename directories to lowercase: Controller→controller, Model→model, Service→service, Util→util, Bootstrap→bootstrap
- Update all namespaces from App\Xxx to app\xxx (webman convention)
- Update all import statements across the codebase
- Update route.php to use lowercase namespaces
- Remove unused CompanyFeishuApp model
- Comment out unimplemented controller routes
Following webman 2.x framework conventions:
- Models: app\model\{ClassName}
- Controllers: app\controller\{ClassName}
- Services: app\service\{ClassName}
- Utils: app\util\{ClassName}
- Middleware: app\middleware\{ClassName}
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
884 B
PHP
48 lines
884 B
PHP
<?php
|
|
|
|
namespace app\model;
|
|
|
|
use support\Model;
|
|
|
|
class ApprovalFlow extends Model
|
|
{
|
|
protected $table = 'approval_flow';
|
|
|
|
protected $fillable = [
|
|
'business_type',
|
|
'name',
|
|
'description',
|
|
'status',
|
|
];
|
|
|
|
protected $casts = [
|
|
'status' => 'integer',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* 关联审批节点
|
|
*/
|
|
public function nodes()
|
|
{
|
|
return $this->hasMany(ApprovalNode::class, 'flow_id')->orderBy('order');
|
|
}
|
|
|
|
/**
|
|
* 获取启用的流程
|
|
*/
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('status', 1);
|
|
}
|
|
|
|
/**
|
|
* 根据业务类型获取流程
|
|
*/
|
|
public function scopeByBusinessType($query, string $businessType)
|
|
{
|
|
return $query->where('business_type', $businessType);
|
|
}
|
|
}
|