如何查询最后一次捐款超过90天的所有用户。这是我的查询,但在执行时出现错误未知列。
$value = Session::get('key');
$dateToday = new DateTime();
$data = Users::where('userType','=', 'user' )
->where($dateToday->format('m/d/Y') - 'lastDonation', '=', 1)
->whereNotIn('username', [$value ])
->get();
最佳答案
$data = Users::where('userType','=', 'user' )
->where('lastDonation', '<', Carbon::now()->subDays(90))
->whereNotIn('username', [$value ])
->get();
关于PHP laravel 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35076435/