dptpn06684
2018-07-12 07:34
浏览 180
已采纳

调用未定义的函数App \ select()

I have in my model this function and i get the error in my log.

What could be causing this or do i have import a lib?

PS: Laravel Beginner

Call to undefined function App\select()

Model

public function daily_toast() 
{    
    return $this->daily—>select(‘toast’, DB::raw('count(*) as daily_toast'))->get();  
}
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douzhantao2857 2018-07-12 07:35
    已采纳

    I think daily() is relation, try this:

      public function daily_toast() 
      {    
         return $this->daily()->select(‘toast’, DB::raw('count(*) as daily_toast'))->get();  
      }
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题