示例#1
0
 public function store(Request $request)
 {
     $data = $this->getData($request);
     $data['created_at'] = time();
     VideoModel::create($data);
     return redirect(DOMAIN . 'member/video');
 }
 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;
 }
示例#3
0
 public function store(Request $request)
 {
     //        //视频上传处理
     //        if($request->hasFile('url_ori')){  //判断文件存在
     //            //验证图片大小
     //            foreach ($_FILES as $pic) {
     //                if ($pic['size'] > $this->uploadVideoSizeLimit) {
     //                    echo "<script>alert(\"对不起,你上传的视频过大,请重新选择\");history.go(-1);</script>";exit;
     //                }
     //            }
     //            $video = $request->file('url_ori');  //获取文件
     //            $url = \App\Tools::uploadVideo($video);
     //        }
     //        if (!isset($url)) {
     //            echo "<script>alert('对不起,您还没上传视频!');history.go(-1);</script>";exit;
     //        }
     $data = $this->getData($request);
     //        $data['url'] = isset($url)?$url:'';
     $data['created_at'] = date('Y-m-d H:i:s', time());
     VideoModel::create($data);
     return redirect(DOMAIN . 'company/admin/video');
 }