fetchSql用於直接返回SQL而不是執行查詢,適用於任何的CURD操作方法。 例如:
$result = Db::table('think_user')->fetchSql(true)->find(1);
輸出result結果爲: SELECT * FROM think_user where id = 1
fetchSql用於直接返回SQL而不是執行查詢,適用於任何的CURD操作方法。 例如:
$result = Db::table('think_user')->fetchSql(true)->find(1);
輸出result結果爲: SELECT * FROM think_user where id = 1