how can query users last donation more 90 days. query when executed error unknown column.
$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();
Comments
Post a Comment