public function update(Request $request, $id) { $data = $this->getData($request); $data['updated_at'] = time(); EntertainModel::where('id', $id)->update($data); return redirect(DOMAIN . 'member/entertainS'); }
/** * 查询方法 */ public function query($del = 0, $genre) { if ($genre) { $datas = EntertainModel::where('del', $del)->where('genre', $genre)->orderBy('id', 'desc')->paginate($this->limit); } else { $datas = EntertainModel::where('del', $del)->orderBy('id', 'desc')->paginate($this->limit); } $datas->limit = $this->limit; return $datas; }
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; }
/** * 获取娱乐信息 */ public function getEntertains($limit) { return EntertainModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); }
/** * 查询方法 */ public function query($del = 0) { $datas = EntertainModel::where('del', $del)->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }