Selamünaleyküm arkadaşlar forumda ve laravel de yeniyim elimde bir sorgu var bunu nasıl orm ile listeleyebilirim yardım ve yorumlarınız için şimdiden çok teşekkür ederim.
SQL Sorgusu
SELECT TOP(10)
refChar.CharID,
refChar.CharName16,
refChar.RemainSkillPoint,
refChar.RefObjID,
refChar.CurLevel,
refChar.HwanLevel,
C.Name,
(
SELECT
SUM(
refObjItem.ItemClass + (
CASE
WHEN binding.nOptValue IS NULL THEN 1
ELSE binding.nOptValue + 1
END
) + (
CASE
WHEN binding.nOptLvl IS NULL THEN 1
ELSE binding.nOptLvl + 1
END
)
) * (item.OptLevel + 1) + refObjChar.Rarity + refObjItem.SetID + item.MagParamNum
FROM SRO_VT_SHARD._Inventory inventory
INNER JOIN SRO_VT_SHARD._Items item ON inventory.ItemID = item.ID64
LEFT OUTER JOIN SRO_VT_SHARD._BindingOptionWithItem binding ON item.ID64 = binding.nItemDBID
INNER JOIN SRO_VT_SHARD._RefObjCommon refObjChar ON refObjChar.ID = item.RefItemID
INNER JOIN SRO_VT_SHARD._RefObjItem refObjItem ON refObjChar.Link = refObjItem.ID
WHERE
inventory.CharID = refChar.CharID
AND item.RefItemID != 0
AND inventory.ItemID != 0
AND refObjChar.ReqLevel1 != 0
AND inventory.Slot BETWEEN 0 AND 12
) AS Puan,
C.Name AS GuildName
FROM SRO_VT_SHARD._Char refChar
LEFT OUTER JOIN SRO_VT_SHARD._Guild C ON C.ID = refChar.GuildID
WHERE refChar.CharName16 NOT LIKE '%GM%'
GROUP BY
refChar.CharName16,
C.Name,
refChar.HwanLevel,
refChar.CurLevel,
refChar.CharID,
refChar.RefObjID,
refChar.RemainSkillPoint
ORDER BY
Puan DESC,
refChar.CurLevel DESC;