drutcs7210 2014-12-09 17:15
浏览 555
已采纳

Laravel中的select和where子句eloquent

Im trying to get three columns of my DB, but I don't get it...

I can use this code. But this way returned all the columns, and only I want three of them.

User::where('name', 'LIKE', $term)->get()

And I know use this other code: But... in them I cannot use the "where" clausule.

User::select(array('id', 'name', 'email'))

Anybody know one way to merge the both codes? Perhaps the only way to do that is using Fluent?

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥60 dpabi进行Alff计算时脑池有干扰信号
      • ¥15 利用kmeans或kshape聚类分析对归一化的无量纲时间-降雨序列进行聚类
      • ¥20 misc尽快完成,急! ! !
      • ¥15 protel99.SE提示一下弹窗
      • ¥15 银河麒麟v10 执行.run失败如何解决
      • ¥15 如何用Python打开LA文件
      • ¥15 用mysql做一个高校工资管理系统
      • ¥21 Multisim设计用三端集成稳压器设计稳压电路
      • ¥15 tp6,在iframe里的网址通过获取url参数失败
      • ¥15 打开opendaylight查看拓扑,为什么直接就显示了两个Switch,在mininet配置了一个topo,这两个Switch还在