Merge branch 'develop'
This commit is contained in:
@@ -75,6 +75,7 @@ class ApprovalInstances extends Model
|
||||
// ====== ====== ====== 映射业务表 ====== ====== ======
|
||||
protected const BIZ_CLASS = [
|
||||
'stock_orders' => \app\common\model\StockOrders::class,
|
||||
'stock_orders_nullify' => \app\common\model\StockOrders::class,
|
||||
'purchase_orders' => \app\common\model\PurchaseOrders::class,
|
||||
];
|
||||
|
||||
@@ -85,7 +86,7 @@ class ApprovalInstances extends Model
|
||||
|
||||
public function bizInfo()
|
||||
{
|
||||
return $this->morphTo('bizInfo', 'biz_type', 'biz_id');
|
||||
return $this->morphTo('bizInfo', 'biz_type', 'biz_id')->withTrashed();
|
||||
}
|
||||
// ====== ====== ====== 映射表业务 ====== ====== ======
|
||||
|
||||
|
||||
@@ -4,9 +4,13 @@ namespace app\common\model;
|
||||
|
||||
use support\Model;
|
||||
use app\common\traits\HasMoneyJournal;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class StockOrders extends Model
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
* The connection name for the model.
|
||||
*
|
||||
|
||||
@@ -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', 'scenario_code', 'sort', 'status', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function groupMembers()
|
||||
{
|
||||
return $this->hasMany(UserGroupMembers::class, 'group_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user