/** * 获取创意 */ public function getIdeas($limit) { $datas = IdeasModel::where(['del' => 0, 'isshow' => 1])->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); static $number = 1; if (count($datas)) { foreach ($datas as $data) { $data->number = $number++; } } 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 query($cate) { if ($cate) { $datas = IdeasModel::where('del', 0)->where('cate', $cate)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } else { $datas = IdeasModel::where('del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } $datas->limit = $this->limit; return $datas; }
public function query() { $datas = IdeasModel::where('del', 0)->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }