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


PHP Invoice::withTrashed方法代碼示例

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


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

示例1: bulk

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function bulk($entityType = ENTITY_INVOICE)
 {
     $action = Input::get('action');
     $statusId = Input::get('statusId');
     $ids = Input::get('id') ? Input::get('id') : Input::get('ids');
     if ($action == 'delete') {
         $invoices = Invoice::withTrashed()->scope($ids)->get();
         foreach ($invoices as $invoice) {
             BookSale::deleteBook($invoice);
         }
     }
     //$count = $this->invoiceRepo->bulk($ids, $action, $statusId);
     if ($count > 0) {
         $key = $action == 'mark' ? "updated_{$entityType}" : "{$action}d_{$entityType}";
         $message = Utils::pluralize($key, $count);
         Session::flash('message', $message);
     }
     return Redirect::to("{$entityType}");
 }
開發者ID:Vrian7ipx,項目名稱:repocas,代碼行數:25,代碼來源:invoiceController.php

示例2: getQrPath

 public function getQrPath()
 {
     $invoices = Invoice::withTrashed()->scope(false, $this->id)->get(['invoice_number']);
     $max = 0;
     foreach ($invoices as $invoice) {
         $number = intval(preg_replace("/[^0-9]/", "", $invoice->invoice_number));
         $max = max($max, $number);
     }
     $invoice_numberqr = str_pad($max, 4, "0", STR_PAD_LEFT);
     return 'qr/' . $this->account_key . '_' . $invoice_numberqr . '.jpg';
 }
開發者ID:Vrian7ipx,項目名稱:cascadadev,代碼行數:11,代碼來源:Account.php

示例3: getNextInvoiceNumber

 public function getNextInvoiceNumber()
 {
     $invoices = Invoice::withTrashed()->scope(false, $this->id)->get(['invoice_number']);
     $max = 0;
     foreach ($invoices as $invoice) {
         $number = intval(preg_replace("/[^0-9]/", "", $invoice->invoice_number));
         $max = max($max, $number);
     }
     if ($max > 0) {
         return str_pad($max + 1, 4, "0", STR_PAD_LEFT);
     } else {
         return DEFAULT_INVOICE_NUMBER;
     }
 }
開發者ID:poseidonjm,項目名稱:invoice-ninja,代碼行數:14,代碼來源:Account.php

示例4: getNewInvoiceNumber

 public static function getNewInvoiceNumber()
 {
     $lastInvoiceNumber = Invoice::withTrashed()->orderBy('created_at', 'desc')->pluck('invoice_number');
     return $lastInvoiceNumber + 1;
 }
開發者ID:dbakiu,項目名稱:dvc,代碼行數:5,代碼來源:Invoice.php

示例5: delete

 /**
  * Force remove the specified invoice from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function delete($id)
 {
     Invoice::withTrashed()->where('id', $id)->forceDelete();
     Item::withTrashed()->where('invoice_id', $id)->forceDelete();
     return Redirect::route('invoices.index');
 }
開發者ID:mladjom,項目名稱:smartinvoice,代碼行數:12,代碼來源:InvoicesController.php


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