コード例 #1
0
 public function update(Request $request, $id)
 {
     $data = $this->getData($request);
     $data['updated_at'] = time();
     DesignModel::where('id', $id)->update($data);
     //更新搜索表
     $designModel = DesignModel::where('id', $id)->first();
     \App\Models\Home\SearchModel::change($designModel, 9, 'update');
     return redirect(DOMAIN . 'member/designComD');
 }
コード例 #2
0
 public function query($cate)
 {
     if ($cate) {
         $datas = DesignModel::where('del', 0)->where('genre', 1)->where('cate', $cate)->paginate($this->limit);
     } else {
         $datas = DesignModel::where('del', 0)->where('genre', 1)->paginate($this->limit);
     }
     $datas->limit = $this->limit;
     return $datas;
 }
コード例 #3
0
 public function query($genre, $del, $cate)
 {
     if ($genre && $cate) {
         $datas = DesignModel::where('del', $del)->where('genre', $genre)->where('cate', $cate)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif (!$genre && $cate) {
         $datas = DesignModel::where('del', $del)->where('cate', $cate)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre && !$cate) {
         $datas = DesignModel::where('del', $del)->where('genre', $genre)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif (!$genre && !$cate) {
         $datas = DesignModel::where('del', $del)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     }
     $datas->limit = $this->limit;
     return $datas;
 }
コード例 #4
0
 public function query($genre)
 {
     if ($genre == 1) {
         //视频需求,type==1、3是需求
         $datas = GoodsModel::whereIn('type', [1, 3])->where('isshow', 1)->where('isshow2', 1)->where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre == 2) {
         //创意剧本,genre==2是需求
         $datas = IdeasModel::where('genre', 2)->where('isshow', 1)->where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre == 3) {
         //分镜需求,genre==2是需求
         $datas = StoryBoardModel::where('genre', 2)->where('isshow', 1)->where('isshow2', 1)->where('del', 0)->orderBy('sort', 'desc')->orderBy('sort2', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre == 4) {
         //演员需求,genre==2是需求
         $datas = EntertainModel::where('genre', 2)->where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre == 5) {
         //设备需求,genre==2是需求
         $datas = RentModel::where('genre', 2)->where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     } elseif ($genre == 6) {
         //设计需求,genre==2是需求
         $datas = DesignModel::where('genre', 2)->where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     }
     $datas->limit = $this->limit;
     return $datas;
 }
コード例 #5
0
 public function query()
 {
     $datas = DesignModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }
コード例 #6
0
ファイル: HomeController.php プロジェクト: 946493655/culture
 /**
  * 获取设计信息
  */
 public function getDesigns($limit)
 {
     return DesignModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit);
 }
コード例 #7
0
ファイル: SpaceController.php プロジェクト: 946493655/culture
 /**
  * 设计
  */
 public function designs($d_type = 1)
 {
     if ($d_type == 1) {
         $buyerIds = array();
         $buyers = OrderModel::where('del', 0)->whereIn('genre', [1, 2])->where('buyer', $this->userid)->where('isshow', 1)->get();
         if (count($buyers)) {
             foreach ($buyers as $buyer) {
                 $buyerIds[] = $buyer->id;
             }
         }
         $datas = DesignModel::where('del', 0)->whereIn('uid', $buyerIds)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate(4);
     } else {
         if ($d_type == 2) {
             $datas = DesignModel::where('del', 0)->where('uid', $this->userid)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate(4);
         }
     }
     return $datas;
 }