当前位置: 首页>>代码示例>>PHP>>正文


PHP Files::where方法代码示例

本文整理汇总了PHP中Files::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::where方法的具体用法?PHP Files::where怎么用?PHP Files::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Files的用法示例。


在下文中一共展示了Files::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startup

 protected function startup()
 {
     parent::startup();
     $this->pagerFiles = new \Pager($this, 'pagingFiles');
     $this->files = $this->context->createServiceFiles();
     if (!$this->user->isInRole('administrator')) {
         $this->files->where('file.user_id = ' . $this->user->id);
     }
 }
开发者ID:soundake,项目名称:pd,代码行数:9,代码来源:FilesPresenter.php

示例2: getfile

 public static function getfile($module_name, $module_id)
 {
     $file_key = sha1($module_name . $module_id . 'o');
     if (isset(static::$cache[$file_key])) {
         return static::$cache[$file_key];
     } else {
         return static::$cache[$file_key] = Files::where('module_name', $module_name)->where('module_id', intval($module_id))->remember(SettingsModel::one('cachelife'))->first();
     }
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:9,代码来源:Files.php

示例3: get_index

 public function get_index()
 {
     $records = Files::where('parent_id', '=', (int) $_GET['node'])->get();
     $result = '[';
     foreach ($records as $record) {
         $result .= '{
                 text: \'' . $record->text . '\',
                 leaf: ' . ($record->leaf ? 'true' : 'false') . ',
                 id: ' . $record->id . '
              },';
     }
     $result .= ']';
     return $result;
 }
开发者ID:SerdarSanri,项目名称:LextJS,代码行数:14,代码来源:filesnodes.php

示例4: more

 public function more()
 {
     $user = User::with('Course', 'Gender', 'userType')->where('StudentID', Auth::user()->StudentID)->first();
     $adminGroupPages = GroupPage::where('StudentID', Auth::user()->StudentID)->where('delFlag', 0)->orderBy('created_at', 'DESC')->get();
     $groupPages = GroupPageMember::with('groupPages')->where('StudentID', Auth::user()->StudentID)->where('delFlag', 0)->orderBy('created_at', 'DESC')->get();
     if (Auth::user()->UserTypeID == 2) {
         $files = Files::where('delFlag', 0)->where('folderID', 0)->where('OwnerID', Auth::user()->StudentID)->get();
         $fileFolders = FilesFolder::where('OwnerID', Auth::user()->StudentID)->where('delFlag', 0)->orderBy('created_at', 'DESC')->get();
         $activities = GroupPageActivity::where('OwnerID', Auth::user()->StudentID)->where('delFlag', 0)->get();
         $quizzes = Quiz::where('delFlag', 0)->orderBy('created_at', 'DESC')->get();
     } else {
         $activities = GroupPageActivityGroup::with('groupPage', 'groupPageActivityFiles')->where('deadline', '>', date('Y-m-d H:i:s'))->whereExists(function ($q) {
             $q->select(DB::raw(0))->from('grouppagemember')->whereRaw('grouppagemember.grouppageID = grouppageactivitygroup.grouppageID')->where('StudentID', Auth::user()->StudentID)->whereRaw('grouppagemember.delFlag = 0');
         })->orderBy('deadline', 'ASC')->get();
         $quizzes = QuizGroupPage::with('groupPageMember', 'groupPage', 'quiz')->where('delFlag', 0)->whereNotExists(function ($q) {
             $q->select(DB::raw(0))->from('quiztaken', 'grouppagemember')->where('quiztaken.OwnerID', Auth::user()->StudentID)->whereRaw('quiztaken.quizID = quizgrouppage.quizID')->where('delFlag', 0);
         })->get();
     }
     return View::make('validated.more', compact('user', 'adminGroupPages', 'groupPages', 'files', 'fileFolders', 'activities', 'quizzes'));
 }
开发者ID:NoName1771,项目名称:QCPU-Social-Web-App,代码行数:20,代码来源:AppController.php

示例5: listedFiles

 public function listedFiles()
 {
     $files = Files::where('id_inscription', '=', $this->id)->orderBy('created_at', 'asc')->get();
     // dd($files);
     /*$files = $this->hasMany('Files', 'id_inscription', 'id')->orderBy('created_at','ASC');*/
     $archivitos = array();
     // dd(substr($files[0]->title, -1));
     // dd(count($files));
     for ($i = 0, $counter = 1; $i < count($files);) {
         $band = false;
         $position = null;
         for ($j = 0; $j < count($files); $j++) {
             if (substr($files[$j]->title, -1) == $counter) {
                 // var_dump(substr($files[$j]->title, -1));
                 $band = true;
                 $position = $j;
             }
         }
         if ($band) {
             $archivitos[] = $files[$position];
             $i++;
         } else {
             // var_dump(null."Aqui");
             $archivitos[] = null;
         }
         /*if(substr($files[$i]->title, -1) == $counter+1):
         			var_dump(substr($files[$i]->title, -1));
         			$archivitos[] = $files[$i];
         			$i++;
         		else:
         			var_dump('No');
         			$archivitos[] = null;
         		endif;*/
         $counter++;
     }
     // dd(new Illuminate\Database\Eloquent\Collection($archivitos));
     return new Illuminate\Database\Eloquent\Collection($archivitos);
 }
开发者ID:nagyist,项目名称:abge,代码行数:38,代码来源:Inscriptions.php

示例6: postPostsaveord

 public function postPostsaveord()
 {
     $order = Input::get('order');
     $id = Input::get('id');
     $kappa = Files::where('id', $id)->first();
     $kappa->ord = $order;
     $kappa->save();
     return [];
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:9,代码来源:HomeController.php

示例7: add

 /**
  * Upload file
  * @return array
  */
 public function add()
 {
     $data = array('module_id' => Input::get('module_id'), 'module_name' => Input::get('module_name'), 'num' => Input::get('num'), 'filepath' => Input::get('path'));
     $filename = ltrim($data['filepath'], '/');
     $name = basename($filename);
     $extension = pathinfo($filename, PATHINFO_EXTENSION);
     $dbfile = Files::where('path', 'like', "%{$name}")->first();
     if ($dbfile) {
         $filename = $dbfile->path;
         $name = $dbfile->name;
         $extension = $dbfile->extension;
     }
     $fid = Files::register($name, $filename, $extension, $data['module_name'], $data['module_id']);
     $data['error'] = '0';
     $data['succes'] = 'Uploaded!';
     Log::info("File added #{$fid} - '{$filename}'");
     return $data;
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:22,代码来源:UploaderController.php

示例8: getDownloadFile

 /**
  * Download a File
  */
 public function getDownloadFile($md5)
 {
     //Get the file
     $file = \Files::where('key', '=', $md5)->first();
     //Check if file exists
     if (file_exists($file['file_sys_ref'] . $file['file_md5'])) {
         return Response::download($file['file_sys_ref'] . $file['file_md5'], $file['file_name']);
     } else {
         Log::error("File " . $file['file_name'] . " does not exists.");
         throw new \FileNotFoundException();
     }
 }
开发者ID:ymnl007,项目名称:92five,代码行数:15,代码来源:DashboardController.php

示例9: deleteFileFolder

 public function deleteFileFolder($id)
 {
     $folder = FilesFolder::find($id);
     if (Auth::user()->StudentID == $folder->OwnerID) {
         FilesFolder::find($id)->update(array('delFlag' => 1)) ? Files::where('folderID', $id)->update(array('delFlag' => 1)) : '';
     }
 }
开发者ID:NoName1771,项目名称:QCPU-Social-Web-App,代码行数:7,代码来源:FilesController.php

示例10: getThumbsDown

 public function getThumbsDown($id)
 {
     try {
         $file = Files::where('id', $id)->firstOrFail();
         $this->googleAnalytics('/files/thumbs-down/' . $id);
         $file->thumbs_down++;
         $file->save();
         $thumbs = array();
         if (Cookie::get('ps_thumbs')) {
             $cookie = Cookie::get('ps_thumbs');
             $thumbs = unserialize($cookie);
             if (isset($thumbs['files'][$file->id])) {
                 return Response::json(array('status' => 'fail', 'message' => __("Већ сте оценили овај материјал")));
             }
         }
         $thumbs['files'][$file->id] = 'down';
         Cookie::queue('ps_thumbs', serialize($thumbs), '86400');
         $response = array('status' => 'success', 'message' => __("Хвала на труду. Ваш глас је забележен"), 'thumbsUp' => $file->thumbs_up, 'thumbsDown' => $file->thumbs_down);
         return Response::json($response);
     } catch (Exception $e) {
         return Response::json(array('status' => 'fail'));
     }
 }
开发者ID:Puskice,项目名称:PuskiceCMS,代码行数:23,代码来源:ApiFileController.php

示例11:

<?php

$records = Files::where('parent_id', '=', (int) $_GET['node'])->get();
?>
[
            <?php 
foreach ($records as $record) {
    ?>
                      
                         
                                    {
                                    text: '<?php 
    echo $record->text;
    ?>
',
                                    leaf: <?php 
    if ($record->leaf) {
        echo 'true';
    } else {
        echo 'false';
    }
    ?>
,
                                    id: <?php 
    echo $record->id;
    ?>
                                     },
                                         
            <?php 
}
?>
开发者ID:SerdarSanri,项目名称:LextJS,代码行数:31,代码来源:nodes.php

示例12: coverImage

 public static function coverImage($id)
 {
     return Files::where(array('module_name' => 'post_cover', 'module_id' => $id))->remember(SettingsModel::one('cachelife'))->first();
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:4,代码来源:Post.php

示例13: route

 public function route($query = '')
 {
     $parts = explode('/', $query);
     if ($parts) {
         $uri = end($parts);
         $this->data['page'] = Post::findURI($uri, 1);
         if ($this->data['page']) {
             PostResources::init();
             // Verify if page is redirectable
             if ($this->data['page']->redirect_to) {
                 $redirect_url = Post::getFullURI($this->data['page']->redirect_to);
                 if ($redirect_url) {
                     return Redirect::to($redirect_url);
                 }
             }
             // Verify if page is redirectable
             if ($this->data['page']->redirect_to) {
                 $redirect_url = Post::getFullURI($this->data['page']->redirect_to);
                 if ($redirect_url) {
                     return Redirect::to($redirect_url);
                 }
             }
             Template::clearBreadCrumbs();
             Template::addBreadCrumb("/", varlang('acasa'));
             // Get pages resources
             $this->data['parents'] = Post::getParents($this->data['page']['parent'], 1);
             $this->data['parent'] = Post::findID($this->data['page']['parent'], 1);
             $this->data['colevels'] = Post::findWithParent($this->data['page']['parent']);
             $this->data['super_parent'] = array_first($this->data['parents'], function ($key, $item) {
                 return $item['parent'] == 0;
             });
             // get real page URI
             $segments = array();
             $parrents_ids = array($this->data['page']->id);
             foreach (array_reverse($this->data['parents']) as $parrent) {
                 $segments[] = $parrent['uri'];
                 $parrents_ids[] = $parrent['id'];
                 Template::addBreadCrumb(Post::getURL(implode('/', $segments)), $parrent['title']);
             }
             $segments[] = $this->data['page']['uri'];
             Template::addBreadCrumb(Post::getURL($query), $this->data['page']['title']);
             $realURI = implode('/', $segments);
             // Verify if real uri is correct
             if ($realURI === $query) {
                 // get global data
                 View::share(array('active_page_id' => $this->data['page']->id, 'parrents_ids' => $parrents_ids, 'super_parent' => $this->data['super_parent']));
                 // Verify if this page is clone
                 if ($this->data['page']->clone_id) {
                     $clone = Post::findID($this->data['page']->clone_id, 1);
                     if ($clone) {
                         $this->data['page'] = $clone;
                     }
                 }
                 // Set page title
                 $this->data['top_title'] = $this->data['page']['title'];
                 WebAPL\Template::setPageTitle($this->data['page']['title']);
                 $this->data['page_url'] = WebAPL\Language::url("page/" . $realURI);
                 // Get page files
                 if ($this->data['page']->show_files) {
                     $this->data['page']['files'] = Files::where(array('module_name' => 'page', 'module_id' => $this->data['page']->id, 'type' => 'document'))->remember(SettingsModel::one('cachelife'))->get();
                 } else {
                     $this->data['page']['files'] = array();
                 }
                 // register one view
                 Post::oneView($this->data['page']['id']);
                 Template::setMetaMultiple(array('og:title' => $this->data['page']->title, 'description' => $this->data['page']->text, 'og:description' => $this->data['page']->text), true);
                 // load page
                 PageController::loadGeneralResources();
                 View::share('page', $this->data['page']);
                 if ($this->data['page']->general_node) {
                     return $this->loadHome();
                 } else {
                     return $this->loadPage();
                 }
             } else {
                 throw new Exception("Query '{$query}' is not valid", 404);
             }
         } else {
             throw new Exception("Page with uri '{$uri}' not found", 404);
         }
     } else {
         throw new Exception("No valid page URI", 404);
     }
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:84,代码来源:PageController.php

示例14: fileListPrepare

 public static function fileListPrepare($field, $post)
 {
     return Files::where(array('module_name' => 'doc_post_lang', 'module_id' => $post->post_lang_id, 'type' => 'document'))->get();
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:4,代码来源:DinamicFields.php

示例15: dropFile

 public static function dropFile($path, $id = 0)
 {
     $used = Files::where('path', 'like', "%{$path}")->where('id', '<>', $id)->count();
     if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . $path) && $used == 0) {
         unlink($_SERVER['DOCUMENT_ROOT'] . '/' . $path);
     }
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:7,代码来源:Files.php


注:本文中的Files::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。