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');
 }
Example #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;
 }
Example #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;
 }
Example #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;
 }
Example #5
0
 /**
  * 初始化搜索表
  */
 public function init()
 {
     //在线创作表
     $products = ProductModel::all();
     if (count($products)) {
         $rst['product'] = $this->tochange($products, 'product');
     } else {
         $rst['product'] = "在线创作表 product 没有记录!";
     }
     //上传的产品表
     $goods = GoodsModel::all();
     if (count($goods)) {
         $rst['goods'] = $this->tochange($goods, 'goods');
     } else {
         $rst['goods'] = "上传的产品表 goods 没有记录!";
     }
     //创意表
     $ideas = IdeasModel::all();
     if (count($ideas)) {
         $rst['idea'] = $this->tochange($ideas, 'idea');
     } else {
         $rst['idea'] = "创意表 idea 没有记录!";
     }
     //分镜表
     $storyboards = StoryBoardModel::all();
     if (count($ideas)) {
         $rst['storyboard'] = $this->tochange($storyboards, 'storyboard');
     } else {
         $rst['storyboard'] = "分镜表 storyboard 没有记录!";
     }
     //公司表
     $companys = CompanyModel::all();
     if (count($ideas)) {
         $rst['company'] = $this->tochange($companys, 'company');
     } else {
         $rst['company'] = "公司表 company 没有记录!";
     }
     //影视作品表
     $works = WorksModel::all();
     if (count($works)) {
         $rst['works'] = $this->tochange($works, 'works');
     } else {
         $rst['works'] = "作品表 works 没有记录!";
     }
     //演员表
     $actors = StaffModel::where('genre', 1)->get();
     if (count($actors)) {
         $rst['actor'] = $this->tochange($actors, 'actor');
     } else {
         $rst['actor'] = "人员表演员 actor 没有记录!";
     }
     //租赁表
     $rents = RentModel::all();
     if (count($rents)) {
         $rst['rent'] = $this->tochange($rents, 'rent');
     } else {
         $rst['rent'] = "租赁表 rent 没有记录!";
     }
     //设计表
     $designs = DesignModel::all();
     if (count($designs)) {
         $rst['design'] = $this->tochange($designs, 'design');
     } else {
         $rst['design'] = "设计表 design 没有记录!";
     }
     dd($rst);
 }
Example #6
0
 public function query()
 {
     $datas = DesignModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }
Example #7
0
 /**
  * 获取设计信息
  */
 public function getDesigns($limit)
 {
     return DesignModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit);
 }
Example #8
0
 /**
  * 设计
  */
 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;
 }