Пример #1
0
 public function pre($id)
 {
     $proVideo = ProductVideoModel::find($id);
     $result = ['video' => VideoModel::find($proVideo->video_id), 'videoName' => $proVideo->name];
     return view('layout.videoPre', $result);
 }
Пример #2
0
 /**
  * 得到离线模板、无模板信息
  */
 public function getProVideo()
 {
     $productVideo = ProductVideoModel::find($this->productid);
     return $productVideo ? $productVideo : '';
 }
Пример #3
0
 public function query($genre, $cate)
 {
     if ($genre == 1) {
         if ($cate) {
             $datas = ProductModel::where('cate', $cate)->where('video_id', '>', 0)->orderBy('id', 'desc')->paginate($this->limit);
         } else {
             $datas = ProductModel::where('video_id', '>', 0)->orderBy('id', 'desc')->paginate($this->limit);
         }
     } elseif (in_array($genre, [2, 3])) {
         if ($cate) {
             $datas = ProductVideoModel::where('cate', $cate)->where('genre', $genre - 1)->orderBy('id', 'desc')->paginate($this->limit);
         } else {
             $datas = ProductVideoModel::where('genre', $genre - 1)->orderBy('id', 'desc')->paginate($this->limit);
         }
     }
     $datas->limit = $this->limit;
     return $datas;
 }