当前位置: 首页>>代码示例>>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;未经允许,请勿转载。