home page mobile changed

This commit is contained in:
merdan 2020-03-28 15:26:16 +05:00
parent 77de064069
commit dcb0c75d45
2 changed files with 4 additions and 3 deletions

View File

@ -58,8 +58,7 @@ class PublicController extends Controller
$query->onLive($data['start'], $data['end']);
})
->with(['cat_events' => function($q) use($data,$order){
$q->onLive($data['start'], $data['end'])
->take(20)
$q->onLive($data['start'], $data['end'],8)
->orderBy($order['field'],$order['order']);
}]);
// $query->withLiveEvents($order, $data['start'], $data['end']);

View File

@ -490,7 +490,7 @@ ICSTemplate;
return (is_null($this->access_codes()->where('id', $accessCodeId)->first()) === false);
}
public function scopeOnLive($query, $start_date = null, $end_date = null){
public function scopeOnLive($query, $start_date = null, $end_date = null,$limit = false){
//if date is null carbon creates now date instance
//todo what if only end date is null??
if(!empty($start_date) && !empty($end_date))
@ -500,6 +500,8 @@ ICSTemplate;
}
else
$query->where('end_date','>',Carbon::now(config('app.timezone')));
if($limit)
$query->take($limit);
return $query->where('is_live',1)
->withCount(['images as image_url' => function($q){