Commit 72c7caa0 by 杨昕

code format

parent e7f95991
Pipeline #10378 passed with stages
in 45 seconds
...@@ -460,7 +460,24 @@ class MediaModel extends Eloquent ...@@ -460,7 +460,24 @@ class MediaModel extends Eloquent
} }
$aggregate[]['$sort'] = ['start_time' => $sort]; $aggregate[]['$sort'] = ['start_time' => $sort];
$count = sizeof($collection->aggregate($aggregate)->toArray());
$aggregate1=$aggregate;
$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 = sizeof($collection->aggregate($aggregate)->toArray());
$skip = ((empty($request->page) ? 1 : $request->page)-1) * $limit; $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