Пишет что нет такого столбца. ?
$model = AdwertClients::with(['adwert'])->select('*', \DB::raw('count(id) as ind_count, (SELECT COUNT(id) FROM adwert_clients WHERE status = 0) as no_confirmed, (SELECT COUNT(id) FROM adwert_clients WHERE status = 2) as confirmed, (SELECT COUNT(id) FROM adwert_clients WHERE status = 1) as not_approved'))->where([
'user_id' => Auth::user()->id,
'adwert_id' => $id,
]);
if($modelAdwert != []){
$model = $model->where(
'DATE(created_at)','>=',"DATE(DATE_ADD(created_at, INTERVAL 7 DAY))"
);
}
Column not found: 1054 Unknown column 'DATE(created_at)' in 'where clause' (SQL: select *, count(id) as ind_count, (SELECT COUNT(id) FROM adwert_clients WHERE status = 0) as no_confirmed, (SELECT COUNT(id) FROM adwert_clients WHERE status = 2) as confirmed, (SELECT COUNT(id) FROM adwert_clients WHERE status = 1) as not_approved from `adwert_clients` where (`user_id` = 1 and `adwert_id` = 27) and `DATE(created_at)` >= DATE(DATE_ADD(created_at, INTERVAL 7 DAY)) group by `adwert_id`)