konakona
V2EX  ›  问与答

laravel orderBy()方法不要`的办法

  •  
  •   konakona · Sep 27, 2017 · 3446 views
    This topic created in 3355 days ago, the information mentioned may be changed or developed.
    orderBy("field(id,{$attachmentsStr})","asc")


    然后 laravel 给它加了撇..sql 就报错了。有办法不要加撇吗?
    1 replies  •  2018-09-11 11:28:17 +08:00
    cncqw
    cncqw
    Sep 11, 2018
    1
    用 orderByRaw 写原生的 sql
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2075 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 08:20 · PVG 16:20 · LAX 00:20 · JFK 03:20
    ♥ Do have faith in what you're doing.