采购单处理

This commit is contained in:
root
2025-09-22 15:50:36 +08:00
parent e12d5951e4
commit bdefd69a13
6 changed files with 254 additions and 27 deletions
+22
View File
@@ -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');
}
}