MySql查询过去90天的laravel版本

时间:2017-03-04 14:25:07

标签: php mysql laravel

如何查询:

SELECT *
FROM invoice_client
WHERE date_sending < DATE_ADD(NOW(), INTERVAL -90 DAY) AND
      date_sending <> '0000-00-00' AND
      approve <> '1'
laravel版本中的

1 个答案:

答案 0 :(得分:0)

DB::table('invoice_client')
   ->where("date_sending","!=","0000-00-00")
   ->where("date_sending",">",date("Y-m-d",time()-3600*24*90))
   ->where("approve","!=",1)
   ->get();

你可以试试上面的代码吗?