@php
//$date = date('d-m-y');
//$today = App\Models\Order::where('order_date',$date)->where('vendor_id',auth()->user()->id)->sum('amount');
// $date = Illuminate\Support\Carbon::createFromFormat('d-m-y', date('d-m-y'))->format('Y-m-d');
// $today = App\Models\Order::where('order_date',$date)->where('vendor_id',auth()->user()->id)->sum('amount');
// $today = App\Models\Order::whereDate('order_date', $date)
// ->where('vendor_id', auth()->user()->id)
// ->sum('amount');
$date = Illuminate\Support\Carbon::createFromFormat('d-m-y', date('d-m-y'))->format('Y-m-d');
$formattedDate = Illuminate\Support\Carbon::parse($date)->format('d F Y');
$today = App\Models\Order::where('order_date', $formattedDate)
->where('vendor_id', auth()->user()->id)->where('status','deliverd')
->sum('amount');
$month = date('F');
$month = App\Models\Order::where('order_month',$month)->where('vendor_id',auth()->user()->id)->where('status','deliverd')->sum('amount');
$year = date('Y');
$year = App\Models\Order::where('order_year',$year)->where('vendor_id',auth()->user()->id)->where('status','deliverd')->sum('amount');
$pending = App\Models\Order::where('status','pending')->where('vendor_id',auth()->user()->id)->get();
// $vendor = App\Models\User::where('status','active')->where('role','vendor')->get();
// $customer = App\Models\User::where('status','active')->where('role','user')->get();
@endphp
@if(auth()->user()->status === 'active')
حساب التاجر الخاص بك مفعل
@else
حساب التاجر الخاص بك غير مفعل
الرجاء الإنتظار لحين مراجعة الحساب الخاص بك من الادارة
@endif
إجمالي مبيعات اليوم
{{--
+4.2%
--}}
إجمالي مبيعات الشهر
{{--
+1.2%
--}}
إجمالي مبيعات السنة
{{--
+5.2%
--}}
@php
//$orders = App\Models\Order::where('status','pending')->orderBy('id','DESC')->limit(10)->get();
$orders = App\Models\Order::orderBy('id','DESC')->where('vendor_id',auth()->user()->id)->limit(10)->get();
@endphp
| رقم |
تاريخ الطلب |
رقم الفاتورة |
القيمة |
طريقة الدفع |
الحالة |
@foreach($orders as $key => $order)
| {{ $key+1 }} |
@php
// $get_date = Illuminate\Support\Carbon::parse($order->order_date)->diffForHumans();
$get_date = Illuminate\Support\Carbon::parse($order->created_at)->diffForHumans();
@endphp
{{ $get_date
}} |
{{ $order->invoice_no }} |
{{ $order->amount }} |
{{ $order->payment_method }} |
@if ($order->status == 'pending')
الطلب قيد المعالجة
@elseif($order->status == 'confirm')
تم تأكيد الطلب
@elseif($order->status == 'processing')
جاري تحضير الطلب
@else
تم تسليم الطلب
@endif
|
@endforeach
@endsection