Commit e506c7c6 by 杨昕

优化媒资列表

parent fdc5adc3
Pipeline #14139 passed with stages
in 3 minutes 42 seconds
......@@ -100,23 +100,9 @@ class MediaModel extends Eloquent
$aggregate[]['$match'] = $match;
$aggregate1 = $aggregate;
$aggregate[]['$sort'] = ['start_time' => $sort];
$aggregate1[]['$group'] = [
'_id' => array(),//更具性别进行分组
'count'=>array('$sum'=>1)
];
$count = $collection->aggregate($aggregate1)->toArray();
if (isset($count[0])){
$count = $count[0]['count'];
}else{
$count = 0;
}
$count = MediaModel::where($match)->count();
$skip = ((empty($request->page) ? 1 : $request->page)-1) * $limit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment