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


PHP File::with方法代码示例

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


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

示例1: postDataUploaded

 /**
  * 
  */
 public function postDataUploaded(Request $req, $db)
 {
     $page = 1;
     if ($req->get('page')) {
         $page = $req->get('page');
     }
     $rows = 10;
     if ($req->get('rows')) {
         $rows = $req->get('rows');
     }
     $Files = File::with('user', 'import')->skip($page)->where('db_table', $db)->take($rows)->paginate();
     $rows = [];
     $i = 0;
     foreach ($Files as $file) {
         $rows[$i] = $file;
         // $rows[$i]['oleh']=$file['user']['email']; $i++;
         $rows[$i]['user.email'] = !empty($file->user) ? $file->user->email : 'tidak diketahui ';
         $rows[$i]['import.status_import'] = !empty($file->import) ? $file->import->status_import : 'Belum';
         // dd($file->import->user->email);
         $rows[$i]['import.user.email'] = !empty($file->import->user->email) ? $file->import->user->email : 'Belum';
         $i++;
         // $rows[$i]['import.users.email']=(!empty($file['import']) && !empty($file['import']['users_id']) )? $file['import']['status_import']: '----'; $i++;
     }
     $result['total'] = $Files->toArray()['total'];
     // $result['rows']=$entries->toArray()['data'];
     $result['rows'] = $rows;
     return json_encode($result);
 }
开发者ID:acmadi,项目名称:integrasi,代码行数:31,代码来源:ExcelController.php

示例2: postDataImported

 /**
  * 
  */
 public function postDataImported(Request $req, $db)
 {
     $page = 1;
     if ($req->get('page')) {
         $page = $req->get('page');
     }
     $rows = 10;
     if ($req->get('rows')) {
         $rows = $req->get('rows');
     }
     $entries = File::with('user', 'import', 'eksport')->skip($page)->where('db_table', $db)->take($rows)->paginate();
     // dd($rows);
     // dd($entries->toArray());
     $newEntry = [];
     $i = 0;
     // foreach ($entries->toArray()['data'] as $entry) {
     foreach ($entries as $entry) {
         // dd($entry);
         $newEntry[$i] = $entry;
         // $newEntry[$i]['oleh']=$entry['user']['email']; $i++;
         $newEntry[$i]['email'] = !empty($entry->user) ? $entry->user->email : 'tidak diketahui ';
         $newEntry[$i]['import.status_import'] = !empty($entry->import) ? $entry->import->status_import : 'Belum';
         // dd($entry->import->user->email);
         $newEntry[$i]['import.user.email'] = !empty($entry->import->user->email) ? $entry->import->user->email : 'Belum';
         $newEntry[$i]['eksport.status_eksport'] = !empty($entry->eksport) ? $entry->eksport->status_eksport : 'Belum';
         $newEntry[$i]['eksport.user.email'] = !empty($entry->eksport->user->email) ? $entry->eksport->user->email : 'Belum';
         $newEntry[$i]['eksport.link_file'] = !empty($entry->eksport->link_file) ? '<a href="' . $entry->eksport->link_file . '">' . $entry->eksport->nama_file . '</a>' : 'Belum';
         $i++;
         // $newEntry[$i]['import.users.email']=(!empty($entry['import']) && !empty($entry['import']['users_id']) )? $entry['import']['status_import']: '----'; $i++;
     }
     $result['total'] = $entries->toArray()['total'];
     // $result['rows']=$entries->toArray()['data'];
     $result['rows'] = $newEntry;
     return json_encode($result);
 }
开发者ID:acmadi,项目名称:integrasi,代码行数:38,代码来源:ResultDBController.php

示例3: showDashboard

 public function showDashboard(Request $req)
 {
     $leftmenu['dashboard'] = 'active';
     $files = File::with('client', 'technicien', 'laststatus.code.group', 'laststatus.technicien')->get();
     $files = CodeStatus::getThemAllLastStatus($files->toArray());
     return view('dashboard', ['leftmenu' => $leftmenu, 'files' => $files]);
 }
开发者ID:ninir007,项目名称:Ats,代码行数:7,代码来源:DashboardController.php

示例4: dumpFile

 public static function dumpFile()
 {
     $result['reparation'] = '';
     $result['commande'] = '';
     $response = File::with('client', 'technicien')->get();
     foreach ($response as $file) {
         $result['reparation'][] = ['id' => $file->id, 'intern_report' => $file->intern_report, 'client' => $file->intern_report];
     }
     return $result;
 }
开发者ID:ninir007,项目名称:Ats,代码行数:10,代码来源:File.php

示例5: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     clearstatcache();
     $records = 0;
     $deleted = 0;
     foreach (File::with('item')->get() as $fileOb) {
         $file = $fileOb->getFilepath();
         if ($this->checkExistance($file) || fileinode($file) !== $fileOb->inode) {
             $fileOb->delete();
             $deleted++;
         }
         $records++;
     }
     foreach (Item::doesntHave('files')->get() as $item) {
         $file = $item->path;
         if ($this->checkExistance($file)) {
             $item->delete();
             $deleted++;
         }
         $records++;
     }
     $this->line("{$records} processed");
     $this->line("{$deleted} deleted");
 }
开发者ID:bagf,项目名称:laravel-file-search,代码行数:29,代码来源:IndexRecheck.php

示例6: index

 public function index()
 {
     $files = File::with('client', 'technicien', 'laststatus.code')->get();
     $repairs = Repair::with('device')->get();
     $orders = Order::all();
     $leftmenu['files'] = 'active';
     return view('/files/index', ['leftmenu' => $leftmenu, 'files' => $files, 'repairs' => $repairs, 'orders' => $orders]);
 }
开发者ID:ninir007,项目名称:Ats,代码行数:8,代码来源:FilesController.php


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