Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的数据库中有一个名为“玩家”的表。该表中有一个“经验”列。我想获取最高体验,并显示玩家姓名(“玩家”中的“姓名”列)。
比方说:
我曾经想过这样的事情,但无法进一步..
$players = Player::where('experience')->get(); foreach ($players as $player) { // }
尝试这个:
$players = Player::orderBy('experience','desc')->get(); foreach ($players as $player) { // }