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


PHP Order::ReportByDate方法代碼示例

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


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

示例1: _pertanggal

 protected function _pertanggal(Request $request)
 {
     $tanggal = $request->get('tanggal') ? $request->get('tanggal') : date('Y-m-d');
     $reports = Order::ReportByDate($tanggal);
     $reports = ConvertRawQueryToArray($reports);
     return ['tanggal' => Carbon::parse($tanggal), 'reports' => $reports];
 }
開發者ID:sopoisun,項目名稱:narotser-hadni-kodnop,代碼行數:7,代碼來源:ReportController.php

示例2: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     //Log::info("In Handle ".$this->tanggal);
     $tanggal = $this->tanggal;
     $reports = Order::ReportByDate($tanggal);
     $reports = collect($reports)->groupBy('_type_bayar');
     $totalCash = isset($reports['tunai']) ? collect($reports['tunai'])->sum('jumlah') : 0;
     $mergeDebitCcard = [];
     $mergeDebitCcard = isset($reports['debit']) ? array_merge($mergeDebitCcard, $reports['debit']->toArray()) : array_merge($mergeDebitCcard, []);
     $mergeDebitCcard = isset($reports['credit_card']) ? array_merge($mergeDebitCcard, $reports['credit_card']->toArray()) : array_merge($mergeDebitCcard, []);
     $bayarBank = collect($mergeDebitCcard)->groupBy('_bank_id');
     $accountSaldo = AccountSaldo::join('accounts', 'account_saldos.account_id', '=', 'accounts.id')->leftJoin('banks', 'account_saldos.relation_id', '=', 'banks.id')->where('tanggal', $tanggal)->where('account_id', 2)->select(['account_saldos.*', DB::raw('IFNULL(account_saldos.relation_id, "cash")_relation_id')])->get()->groupBy("_relation_id");
     $totals = [];
     if ($totalCash > 0) {
         $totals['cash'] = $totalCash;
     }
     foreach ($bayarBank as $key => $val) {
         $totals[$key] = $val->sum('jumlah') - $val->sum('pajak_pembayaran');
     }
     $actions = [];
     $totalKeys = array_keys($totals);
     foreach ($totalKeys as $bank_id) {
         $nominal = $totals[$bank_id];
         if (!isset($accountSaldo[$bank_id])) {
             // create new
             $inputs = ['tanggal' => $tanggal, 'account_id' => 2, 'nominal' => $nominal];
             if ($bank_id != 'cash') {
                 $inputs += ['type' => 'kredit', 'relation_id' => $bank_id];
             } else {
                 $inputs += ['type' => 'debet'];
             }
             AccountSaldo::create($inputs);
             //$actions[$bank_id] = $inputs;
         } else {
             // update value
             $row = $accountSaldo[$bank_id][0];
             $row = AccountSaldo::find($row['id']);
             $row->update(['nominal' => $nominal]);
             //$actions[$bank_id]  = $row;
         }
     }
     //return $actions;
     //Log::info('Queue End @'.Carbon::now('Asia/Jakarta'));
 }
開發者ID:sopoisun,項目名稱:narotser-hadni-kodnop,代碼行數:49,代碼來源:CountSaleAccount.php


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