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


PHP Account::whereRaw方法代碼示例

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


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

示例1: fire

 public function fire()
 {
     $this->info(date('Y-m-d') . ' Running SendRenewalInvoices...');
     $today = new DateTime();
     $sentTo = [];
     // get all accounts with pro plans expiring in 10 days
     $accounts = Account::whereRaw('datediff(curdate(), pro_plan_paid) = 355')->orderBy('id')->get();
     $this->info(count($accounts) . ' accounts found');
     foreach ($accounts as $account) {
         // don't send multiple invoices to multi-company users
         if ($userAccountId = $this->accountRepo->getUserAccountId($account)) {
             if (isset($sentTo[$userAccountId])) {
                 continue;
             } else {
                 $sentTo[$userAccountId] = true;
             }
         }
         $client = $this->accountRepo->getNinjaClient($account);
         $invitation = $this->accountRepo->createNinjaInvoice($client);
         // set the due date to 10 days from now
         $invoice = $invitation->invoice;
         $invoice->due_date = date('Y-m-d', strtotime('+ 10 days'));
         $invoice->save();
         $this->mailer->sendInvoice($invoice);
         $this->info("Sent invoice to {$client->getDisplayName()}");
     }
     $this->info('Done');
 }
開發者ID:magicians,項目名稱:invoiceninja,代碼行數:28,代碼來源:SendRenewalInvoices.php

示例2: fire

 public function fire()
 {
     $this->info(date('Y-m-d') . ' Running SendRenewalInvoices...');
     $today = new DateTime();
     $accounts = Account::whereRaw('datediff(curdate(), pro_plan_paid) = 355')->get();
     $this->info(count($accounts) . ' accounts found');
     foreach ($accounts as $account) {
         $client = $this->accountRepo->getNinjaClient($account);
         $invitation = $this->accountRepo->createNinjaInvoice($client);
         $this->mailer->sendInvoice($invitation->invoice);
     }
     $this->info('Done');
 }
開發者ID:njmube,項目名稱:invoice-ninja,代碼行數:13,代碼來源:SendRenewalInvoices.php

示例3: fire

 public function fire()
 {
     $this->info(date('Y-m-d') . ' Running SendRenewalInvoices...');
     $today = new DateTime();
     // get all accounts with pro plans expiring in 10 days
     $accounts = Account::whereRaw('datediff(curdate(), pro_plan_paid) = 355')->get();
     $this->info(count($accounts) . ' accounts found');
     foreach ($accounts as $account) {
         $client = $this->accountRepo->getNinjaClient($account);
         $invitation = $this->accountRepo->createNinjaInvoice($client);
         // set the due date to 10 days from now
         $invoice = $invitation->invoice;
         $invoice->due_date = date('Y-m-d', strtotime('+ 10 days'));
         $invoice->save();
         $this->mailer->sendInvoice($invoice);
     }
     $this->info('Done');
 }
開發者ID:nafrente,項目名稱:invoice-ninja,代碼行數:18,代碼來源:SendRenewalInvoices.php

示例4: findWithReminders

 public function findWithReminders()
 {
     return Account::whereRaw('enable_reminder1 = 1 OR enable_reminder2 = 1 OR enable_reminder3 = 1')->get();
 }
開發者ID:rasata,項目名稱:invoice-ninja,代碼行數:4,代碼來源:AccountRepository.php


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