Esempio n. 1
0
 public function show($id)
 {
     $curr['name'] = $this->lists['show']['name'];
     $curr['url'] = $this->lists['show']['url'];
     $result = ['data' => VideoModel::find($id), 'user' => $this->userParam, 'lists' => $this->lists, 'curr' => $curr];
     return view('member.video.show', $result);
 }
Esempio n. 2
0
 public function pre($id)
 {
     $data = GoodsModel::find($id);
     $videoid = $data->video_id ? $data->video_id : 0;
     $result = ['data' => $data, 'video' => VideoModel::find($videoid), 'uid' => $this->userid, 'videoName' => $data->name];
     return view('layout.videoPre', $result);
 }
Esempio n. 3
0
 /**
  * 视频预览
  */
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 /**
  * 前台下的订单,这里统一处理
  */
 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;
 }
Esempio n. 6
0
 /**
  * 获得视频信息
  */
 public function getVideo()
 {
     $videoModel = VideoModel::find($this->video_id);
     return $videoModel ? $videoModel : '';
 }
Esempio n. 7
0
 public function video()
 {
     $videoid = $this->videoid ? $this->videoid : 0;
     $videoModel = VideoModel::find($videoid);
     return $videoModel ? $videoModel : '';
 }
Esempio n. 8
0
 /**
  * 视频
  */
 public function video()
 {
     return $this->video_id ? VideoModel::find($this->video_id) : '';
 }
Esempio n. 9
0
 public function pre($id)
 {
     $data = VideoModel::find($id);
     $result = ['video' => $data, 'videoName' => $data->name];
     return view('layout.videoPre', $result);
 }
Esempio n. 10
0
 public function forceDelete($id)
 {
     //同时销毁对应的视频
     $picModel = VideoModel::find($id);
     if (unlink(ltrim($picModel->url, '/')) && VideoModel::where('id', $id)->delete()) {
         echo "<script>alert('图片销毁成功!');window.location.href='" . DOMAIN . "company/admin/video/trash';</script>";
         exit;
     } else {
         echo "<script>alert('图片销毁失败!');window.location.href='" . DOMAIN . "company/admin/video/trash';</script>";
         exit;
     }
 }
Esempio n. 11
0
 public function pre($id)
 {
     $proVideo = ProductVideoModel::find($id);
     $result = ['video' => VideoModel::find($proVideo->video_id), 'videoName' => $proVideo->name];
     return view('layout.videoPre', $result);
 }