This commit is contained in:
2026-01-05 14:33:21 +08:00
commit ee348b4925
451 changed files with 39954 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
<?php
namespace app\common\model;
use support\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class PurchaseOrderItems extends Model
{
use SoftDeletes;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'purchase_order_items';
/**
* 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', 'purchase_order_id', 'stock_id', 'stock_items_id', 'stock_items_uqid', 'quantity', 'unit_price', 'total_price', 'remark'];
/**
* 不允许自动填充模型字段
*/
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');
}
}