doutan2456 2014-01-21 17:26 采纳率: 0%
浏览 20
已采纳

从表中选择updated_at不少于15分钟

I want to select all records from two tables using Laravel v4 which aren't less than 15min , but i can't. Here is my code:

return Visit::join('users', 'visits.id', '=', 'users.id')->select('ip','users.id','browser','updated_at','name')->where('updated_at','>',time() - (15*60))->get();
  • 写回答

1条回答 默认 最新

  • doufei3152 2014-01-21 17:33
    关注

    My guess is that updated_at is a DATETIME field, or some derivative.

    Compare with:

    ->where('updated_at','>', date("Y-m-d H:i:s", time() - (15*60)))
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?