hasOne(RRobotModel::class, 'id', 'robot_id')->where('del_flag', 0); } //对应站点 public function site(): \Hyperf\Database\Model\Relations\HasOne { return $this->hasOne(RRobotModel::class, 'id', 'site_id')->where('del_flag', 0); } //对应站点单价 public function price(): \Hyperf\Database\Model\Relations\HasMany { return $this->hasMany(RSitePriceModel::class, 'site_id', 'site_id')->where('del_flag', 0); } }