采购单处理
This commit is contained in:
@@ -3,9 +3,14 @@
|
||||
namespace app\common\model;
|
||||
|
||||
use support\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PurchaseOrderItems extends Model
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
/**
|
||||
* The connection name for the model.
|
||||
*
|
||||
@@ -46,4 +51,21 @@ class PurchaseOrderItems extends Model
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function purchaseOrder()
|
||||
{
|
||||
return $this->belongsTo(PurchaseOrders::class, 'purchase_order_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function stockOrder()
|
||||
{
|
||||
return $this->belongsTo(StockOrders::class, 'stock_id', 'id');
|
||||
}
|
||||
|
||||
public function stockOrderItems()
|
||||
{
|
||||
return $this->belongsTo(StockOrderItems::class, 'stock_items_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user