add datatables on orders
This commit is contained in:
@@ -12,9 +12,20 @@ use App\Repositories\Shop\Orders;
|
||||
use App\Repositories\Shop\Paybox;
|
||||
use App\Repositories\Shop\Baskets;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Datatables\Shop\OrdersDataTable;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
public function index(OrdersDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Orders.partials.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function view($uuid)
|
||||
{
|
||||
$data = Orders::getByUUID($uuid);
|
||||
}
|
||||
|
||||
public function order()
|
||||
{
|
||||
$customer = Customers::getWithAddresses();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Datatables\Shop\OrdersDataTable;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -20,9 +21,11 @@ class Customers
|
||||
public static function editProfile($id = false)
|
||||
{
|
||||
$id = $id ? $id : self::getId();
|
||||
$orders_datatable = new OrdersDataTable;
|
||||
$data = [
|
||||
'customer' => self::get($id, ['addresses', 'deliveries', 'orders'])->toArray(),
|
||||
'deliveries' => Deliveries::getAll('sale_channel')->toArray(),
|
||||
'orders' => $orders_datatable->html(),
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@ use App\Models\Shop\Invoice;
|
||||
|
||||
class Invoices
|
||||
{
|
||||
public static function getByUUID($uuid)
|
||||
{
|
||||
return Order::byUUID($uuid)->first();
|
||||
}
|
||||
|
||||
public static function saveInvoice($order_id, $data)
|
||||
{
|
||||
$data['order_id'] = $order_id;
|
||||
|
||||
@@ -10,9 +10,13 @@ use Illuminate\Support\Str;
|
||||
|
||||
class Orders
|
||||
{
|
||||
|
||||
use DateStats;
|
||||
|
||||
public static function getByUUID($uuid)
|
||||
{
|
||||
return Order::byUUID($uuid)->first();
|
||||
}
|
||||
|
||||
public static function saveOrder($data)
|
||||
{
|
||||
$data += $data['basket'];
|
||||
|
||||
Reference in New Issue
Block a user