// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\common\model\order; use cores\BaseModel; use think\model\relation\BelongsTo; /** * 订单发货单商品模型 * Class DeliveryGoods * @package app\common\model\order */ class DeliveryGoods extends BaseModel { // 定义表名 protected $name = 'order_delivery_goods'; // 定义主键 protected $pk = 'id'; protected $updateTime = false; /** * 关联订单商品记录 * @return BelongsTo */ public function goods(): BelongsTo { $module = self::getCalledModule(); return $this->belongsTo("app\\{$module}\\model\\OrderGoods"); } }