public function query() { $uid = $this->userid ? $this->userid : 0; $datas = VideoModel::where('del', 0)->where('uid', $uid)->orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
/** * 视频预览 */ public function video($cid, $id, $videoid) { $company = \App\Models\CompanyModel::find($cid); $data = GoodsModel::find($id); $result = ['data' => $data, 'video' => \App\Models\Base\VideoModel::find($videoid), 'uid' => $company->uid, 'videoName' => $data->name]; return view('layout.videoPre', $result); }
public function pre($id, $video_id) { //去除最新的标识 OrderProductModel::where('id', $id)->update(['is_new' => 2]); $data = VideoModel::find($video_id); $result = ['video' => $data, 'orderProModel' => OrderProductModel::find($id), 'videoName' => $data->name]; return view('layout.videoPre', $result); }
public function insertVideo(Request $request, $id) { if (!$request->pic_id || !$request->link) { echo "<script>alert('图片、视频信息必填选!');history.go(-1);</script>"; exit; } if (!strstr($request->link, '?') || !strstr($request->link, '&')) { echo "<script>alert('视频信息格式不对!');history.go(-1);</script>"; exit; } $links = explode('?', $request->link); $orderProModel = OrderProductModel::find($id); $time = time(); $data = ['uid' => $orderProModel->uid, 'name' => $orderProModel->getProductName(), 'url' => $links[0], 'url2' => $links[1], 'pic_id' => $request->pic_id, 'created_at' => $time]; VideoModel::create($data); $videoModel = VideoModel::where($data)->first(); return $videoModel; }
/** * 前台下的订单,这里统一处理 */ public function create() { if (AjaxRequest::ajax()) { $data = Input::all(); //假如已有类似订单 $order = OrderModel::where(['genre' => $data['genre'], 'fromid' => $data['id']])->first(); if (count($order)) { echo json_encode(array('code' => '-2', 'message' => '你已经申请此订单,不能重复申请!')); exit; } //1创意供应,2创意需求,3分镜供应,4分镜需求,5视频供应,6视频需求,7娱乐供应,8娱乐需求,9演员供应,10演员需求,1租赁供应,12租赁需求 if (in_array($data['genre'], [1, 2])) { $ideaModel = \App\Models\IdeasModel::find($data['id']); $productname = $ideaModel->name; $sellerid = $ideaModel->uid; } elseif (in_array($data['genre'], [3, 4])) { $storyBoardModel = \App\Models\StoryBoardModel::find($data['id']); $productname = $storyBoardModel->name; $sellerid = $storyBoardModel->uid; } elseif (in_array($data['genre'], [5, 6])) { $videoModel = \App\Models\Base\VideoModel::find($data['id']); $productname = $videoModel->name; $sellerid = $videoModel->uid; } //获取供应方信息 $userModel = UserModel::find($sellerid); //插入订单表 $order = ['name' => $productname, 'serial' => date('YmdHis', time()) . rand(0, 10000), 'genre' => $data['genre'], 'fromid' => $data['id'], 'seller' => $sellerid, 'sellerName' => $userModel->username, 'buyer' => $this->userid, 'buyerName' => \Session::get('user.username'), 'status' => 1, 'created_at' => time()]; OrderModel::create($order); //插入支付表 $orderModel = OrderModel::where($order)->first(); $pay = ['genre' => 1, 'order_id' => $orderModel->id, 'created_at' => time()]; PayModel::create($pay); echo json_encode(array('code' => '0', 'message' => '操作成功!')); exit; } echo json_encode(array('code' => '-1', 'message' => '非法操作!')); exit; }
/** * 获得视频信息 */ public function getVideo() { $videoModel = VideoModel::find($this->video_id); return $videoModel ? $videoModel : ''; }
public function video() { $videoid = $this->videoid ? $this->videoid : 0; $videoModel = VideoModel::find($videoid); return $videoModel ? $videoModel : ''; }
/** * 视频 */ public function video() { return $this->video_id ? VideoModel::find($this->video_id) : ''; }
public function query($del) { $datas = VideoModel::where('del', $del)->where('uid', \Session::get('user.uid'))->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
public function pre($id) { $proVideo = ProductVideoModel::find($id); $result = ['video' => VideoModel::find($proVideo->video_id), 'videoName' => $proVideo->name]; return view('layout.videoPre', $result); }
/** * 供应方发布的样片预览 */ public function video($id, $videoid) { $data = GoodsModel::find($id); $result = ['data' => $data, 'video' => VideoModel::find($videoid), 'uid' => $this->uid, 'videoName' => $data->name]; return view('layout.videoPre', $result); }