审批&备货单
This commit is contained in:
@@ -89,4 +89,10 @@ class StockOrders extends Model
|
||||
{
|
||||
return $this->hasOne(VehMoneyValue::class, 'object_id', 'id')->where('object_scene', 'stock_orders');
|
||||
}
|
||||
|
||||
|
||||
public function salesperson()
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'salesperson_id');
|
||||
}
|
||||
}
|
||||
@@ -56,4 +56,10 @@ class SysDict extends Model
|
||||
{
|
||||
return $this->hasMany(SysDictItem::class, 'dict_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(SysDictCategory::class, 'category_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -46,4 +46,13 @@ class SysDictCategory extends Model
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function dicts()
|
||||
{
|
||||
return $this->hasMany(SysDict::class, 'category_id', 'id')
|
||||
->where('status', 1)
|
||||
->whereNull('deleted_at')
|
||||
->orderBy('id', 'asc');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user