调整审批流&&增加人员分组

This commit is contained in:
mzl
2025-10-10 11:09:37 +00:00
parent 5beaa11cf7
commit 11b5a694ac
17 changed files with 2648 additions and 286 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace app\common\model;
use support\Model;
class UserGroup extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'user_group';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'title', 'sort', 'status', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function groupMembers()
{
return $this->hasMany(UserGroupMembers::class, 'group_id', 'id');
}
}
+60
View File
@@ -0,0 +1,60 @@
<?php
namespace app\common\model;
use support\Model;
class UserGroupMembers extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'user_group_members';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'group_id', 'user_id', 'is_leader', 'is_primary', 'status', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function user()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
public function group()
{
return $this->hasOne(UserGroup::class, 'id', 'group_id');
}
}