當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FileModel::where方法代碼示例

本文整理匯總了PHP中FileModel::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileModel::where方法的具體用法?PHP FileModel::where怎麽用?PHP FileModel::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FileModel的用法示例。


在下文中一共展示了FileModel::where方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: POST_indexAction

 /**
  * 打印任務
  * POST /task/
  * @method POST_index
  * @param fid 文件id
  * @param pid 打印店id
  * @param
  */
 public function POST_indexAction()
 {
     $userid = $this->auth();
     $response['status'] = 0;
     if (!Input::post('fid', $fid, 'int')) {
         $response['info'] = '未選擇文件';
     } elseif (!Input::post('pid', $pid, 'int')) {
         $response['info'] = '未選擇打印店';
     } elseif (!($file = FileModel::where('use_id', $userid)->where('status', '>', 0)->field('url,name,status')->find($fid))) {
         $response['info'] = '沒有該文件或者此文件已經刪除';
     } else {
         $task = TaskModel::create('post');
         $task['name'] = $file['name'];
         $task['use_id'] = $userid;
         $task['pri_id'] = $pid;
         if (!($task['url'] = File::addTask($file['url']))) {
             $response['info'] = '文件轉換出錯';
         } elseif (!($tid = TaskModel::insert($task))) {
             $response['info'] = '任務添加失敗';
         } else {
             $response['status'] = 1;
             $response['info'] = ['msg' => '打印任務添加成功', 'id' => $tid];
         }
     }
     $this->response = $response;
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:34,代碼來源:Task.php

示例2: getDelete

 public function getDelete($id = null)
 {
     if (!is_null($id)) {
         $id = SiteHelpers::encryptID($id, true);
         $del = FileModel::where('id', $id)->first();
         @unlink(public_path('uploads/' . $del->filename));
         FileModel::where('id', $id)->delete();
         return Redirect::to('files')->with('message', SiteHelpers::alert('success', "Data deleted successfully"));
     }
 }
開發者ID:alphatelradius,項目名稱:histogram-tool,代碼行數:10,代碼來源:FilesController.php

示例3: getDestroy

 public function getDestroy()
 {
     $ids = Input::get('del');
     $i = 0;
     foreach ($ids as $id) {
         $del = FileModel::where('id', $id)->first();
         @unlink(public_path('uploads/' . $del->filename));
         FileModel::where('id', $id)->delete();
         $i++;
     }
     return Redirect::to('files')->with('message', SiteHelpers::alert('success', $i . " Data deleted successfully"));
 }
開發者ID:alphatelradius,項目名稱:histogram-tool,代碼行數:12,代碼來源:FilesController.php

示例4: getAdd

 public function getAdd($id = null)
 {
     if ($id == null) {
         $new = new AutomateModel();
         $new->name = "";
         $data['row'] = $new;
         $data['technology'] = TechnologyModel::all();
         $data['plot'] = PlotModel::join('his_technology', 'his_technology.id', '=', 'his_plot.id_tech')->select('his_plot.id', 'his_plot.name', 'his_technology.name as technology')->orderBy('his_plot.id_tech')->get();
         $data['file'] = FileModel::where('filename', 'like', '%xls%')->get();
     } else {
         $id = SiteHelpers::encryptID($id, true);
         $data['technology'] = TechnologyModel::all();
         $data['plot'] = PlotModel::all();
         $data['file'] = FileModel::where('filename', 'like', '%xls%');
         $data['row'] = AutomateModel::where('id', $id)->first();
     }
     return View::make('automate.form', $data);
 }
開發者ID:alphatelradius,項目名稱:histogram-tool,代碼行數:18,代碼來源:AutomateController.php


注:本文中的FileModel::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。