Commit 04bf7d44 by 杨昕

删除媒资清除目标

parent 7d62c2c4
Pipeline #10794 passed with stages
in 41 seconds
......@@ -40,6 +40,15 @@ class MediaModel extends Eloquent
public static function mediaList($request){
try{
$medias = MediaModel::query()->raw(function ($collection) use($request){
......@@ -51,7 +60,7 @@ class MediaModel extends Eloquent
}
$page = $request->page??1;
$aggregate = [];
/**
* 默认降序
*/
......@@ -68,6 +77,7 @@ class MediaModel extends Eloquent
$aggregate[]['$match']['media_type_id'] = $request->category_id;
}
// $aggregate[]['$match']['_id'] = 'mda-864371b9a82d1e21';
if (isset($request->media_name) && !empty($request->media_name)){
......@@ -92,16 +102,15 @@ class MediaModel extends Eloquent
$aggregate[]['$match']['end_time'] = ['$lt' => $end_time ];
}
$aggregate[]['$sort'] = ['start_time' => $sort];
$aggregate1 = $aggregate;
$aggregate1=$aggregate;
$aggregate[]['$sort'] = ['start_time' => $sort];
$aggregate1[]['$group'] = [
'_id' => null,//更具性别进行分组
'_id' => array(),//更具性别进行分组
'count'=>array('$sum'=>1)
];
$count = $collection->aggregate($aggregate1)->toArray();
if (isset($count[0])){
......@@ -136,7 +145,6 @@ class MediaModel extends Eloquent
}
}
return new LengthAwarePaginator($tmp_arr, $count, $limit, $page,[
'path' => Paginator::resolveCurrentPath(),
'pageName' => 'page',
......@@ -405,7 +413,8 @@ class MediaModel extends Eloquent
if (empty($media_catg)){
throw new \Exception("媒资类别不存在");
}
$tmp[] = MediaModel::select("_id","book_num","book_name","secret_key","media_url")->whereIn('book_num',$media_ids)->get();
$tmp[] = MediaModel::select("_id","book_num","book_name","secret_key","media_url")->where("media_type_id",$media_catg['_id'])->whereIn('book_num',$media_ids)->get();
}
}catch (\Exception $exception){
......
......@@ -150,7 +150,7 @@
top:'50%'
});
setTimeout(function () {
window.location.href='/web/media_model';
window.location.href='/web/media_model?media_name={{$media_name}}&media_id={{$media_id}}&start_time={{$start_time}}&end_time={{$end_time}}&category_id={{$category_id}}&appid={{$appid}}';
},2000)
}else{
$('body').toast({
......
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