【问题标题】:Is there any modified query for this query:此查询是否有任何修改过的查询:
【发布时间】:2015-04-25 22:38:18
【问题描述】:

我正在使用 laravel。在我的控制器中,我使用了一个查询(如下所示)。是否有任何修改过的查询?还是没事???

$sub = Studentacademicinfo::where('class','=',$cat)->where('section','=',$section)->get();

【问题讨论】:

    标签: database laravel-4


    【解决方案1】:

    如果你想整理代码,你可以这样做:

    $sub = Studentacademicinfo::whereClass($cat)->whereSection($section)->get();
    

    但生成的 SQL 将是相同的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-16
      • 2021-03-12
      • 2016-04-10
      • 2022-09-29
      • 1970-01-01
      • 2018-08-22
      • 1970-01-01
      相关资源
      最近更新 更多