public function query() { $uid = $this->userid ? $this->userid : 0; $datas = ProductModel::where('del', 0)->where('uid', $uid)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
/** * 总编辑窗口 */ public function edit($productid, $layerid = 0, $con_id = 0, $genre = 1) { $curr['name'] = $this->crumb['']['name']; $curr['url'] = $this->crumb['']['url']; $layer = $this->getOneLayer($productid, $layerid); $result = ['product' => ProductModel::find($productid), 'layers' => $this->getLayers($productid), 'layer' => $layer, 'layerModel' => $this->layerModel, 'cons' => $this->getCons($productid, $layer->id), 'content' => $this->getOneCon($productid, $layer->id, $con_id), 'attr' => $this->getOneAttr($productid, $layer->id, $genre), 'attrModel' => $this->attrModel, 'layerAttrModel' => $this->layerAttrModel, 'pics' => PicModel::all(), 'crumb' => $this->crumb, 'curr' => $curr, 'currUrl' => 'edit', 'layerid' => $layer->id, 'con_id' => $con_id, 'attrGenre' => $genre]; return view('admin.proCreation.index', $result); }
/** * 在线创作查询 */ public function products($type) { //genre==1:个人供应;genre==2:企业供应 if ($type) { $datas = ProductModel::where('del', 0)->where('genre', $type)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } else { $datas = ProductModel::where('del', 0)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } return $datas; }
/** * 以下是要展示的数据 */ public function query($cate) { if ($cate) { $datas = ProductModel::where('cate', $cate)->where('isshow', 2)->where('isauth', 3)->where('uid', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } else { $datas = ProductModel::where('isshow', 2)->where('isauth', 3)->where('uid', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($this->limit); } $datas->limit = $this->limit; return $datas; }
/** * 在线创作的作品 */ public function products($p_type = 1) { if ($p_type == 1) { $buyerIds = array(); $buyers = OrderProductModel::where('del', 0)->where('buyer', $this->userid)->where('isshow', 1)->get(); if (count($buyers)) { foreach ($buyers as $buyer) { $buyerIds[] = $buyer->id; } } $datas = ProductModel::where('del', 0)->whereIn('uid', $buyerIds)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate(10); } else { if ($p_type == 2) { $datas = ProductModel::where('del', 0)->where('uid', $this->userid)->where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate(10); } } return $datas; }
/** * 得到在线模板信息 */ public function getProduct() { $productModel = ProductModel::find($this->productid); return $productModel ? $productModel : ''; }
/** * 获取在线创作 */ public function getProducts($limit) { return ProductModel::where('isshow', 1)->orderBy('sort', 'desc')->orderBy('id', 'desc')->paginate($limit); }
/** * 查询方法 */ public function query() { $datas = ProductModel::orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
public function index($productid, $layerid = 0, $con_id = 0, $genre = 1) { $layer = $this->getOneLayer($productid, $layerid); $result = ['product' => ProductModel::find($productid), 'cons' => $this->getCons($productid, $layer->id), 'content' => $this->getOneCon($productid, $layer->id, $con_id), 'attr' => $this->getOneAttr($productid, $layer->id, $genre), 'attrModel' => $this->attrModel, 'layers' => $this->getLayers($productid), 'layer' => $layer, 'layerModel' => $this->layerModel, 'pics' => $this->model->getUserPics($this->userid), 'layerid' => $layer->id, 'con_id' => $con_id, 'genre' => $genre]; return view('online.frame.index', $result); }
/** * 动画编辑 */ public function play2($productid, $layerid, $con_id, $genre) { $result = ['data' => ProductModel::find($productid), 'layers' => $this->getLayers($productid), 'cons' => $this->getCons($productid, $layerid), 'attrs' => $this->getAttrs($productid, $layerid), 'attrModel' => $this->attrModel]; return view('online.frame.basic.index', $result); }
/** * 获得产品信息 */ public function getProduct($pro_id = null) { $pro_id = $pro_id ? $pro_id : $this->productid; $productModel = ProductModel::find($pro_id); return $productModel ? $productModel : ''; }
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; }
/** * 获取产品记录 */ public function getProduct($id) { $productModel = ProductModel::find($id); $data = ['name' => $productModel->name, 'serial' => $productModel->serial, 'cate' => $productModel->cate, 'gif' => $productModel->gif, 'intro' => $productModel->intro, 'uid' => $this->userid, 'pid' => $id, 'created_at' => time()]; ProductModel::create($data); $productModelNew = ProductModel::where($data)->first(); return $productModelNew->id; }