public function daysOnIndex($id) { $today = date("Y-m-d H:i:s"); $fiveday = date("Y-m-d H:i:s", strtotime('-30 days')); $tenday = date("Y-m-d H:i:s", strtotime('-60 days')); $fifday = date("Y-m-d H:i:s", strtotime('-90 days')); $twentyday = date("Y-m-d H:i:s", strtotime('-120 days')); $tfiveday = date("Y-m-d H:i:s", strtotime('-150 days')); $thurtyday = date("Y-m-d H:i:s", strtotime('-175 days')); $thurtyfiveday = date("Y-m-d H:i:s", strtotime('-200 days')); //$jsonVariable; $today = listing::where('post_author', '=', $id)->where('post_date', '>=', $fiveday)->where('post_date', '<=', $today)->count(); $fiveday = listing::where('post_author', '=', $id)->where('post_date', '>=', $tenday)->where('post_date', '<=', $fiveday)->count(); $tenday = listing::where('post_author', '=', $id)->where('post_date', '>=', $fifday)->where('post_date', '<=', $tenday)->count(); $fifday = listing::where('post_author', '=', $id)->where('post_date', '>=', $twentyday)->where('post_date', '<=', $fifday)->count(); $twentyday = listing::where('post_author', '=', $id)->where('post_date', '>=', $tfiveday)->where('post_date', '<=', $twentyday)->count(); $tfiveday = listing::where('post_author', '=', $id)->where('post_date', '>=', $thurtyday)->where('post_date', '<=', $tfiveday)->count(); $thurtyfiveday = listing::where('post_author', '=', $id)->where('post_date', '>=', $thurtyfiveday)->where('post_date', '<=', $thurtyday)->count(); $days = '[1, ' . $today . '], [2, ' . $fiveday . '], [3, ' . $tenday . '], [4, ' . $fifday . '], [5, ' . $twentyday . '], [6, ' . $tfiveday . '], [7, ' . $thurtyfiveday . ']'; $jsonVariable['days'] = $days; return $jsonVariable; }
public function listcountbyagent($id) { $listcount = listing::where('post_author', '=', $id)->count(); return $listcount; }