[WIP] Working on orders & invoices
This commit is contained in:
@@ -11,7 +11,10 @@ class Orders
|
||||
{
|
||||
$basket = $data['basket'];
|
||||
unset($data['basket']);
|
||||
dump($data);
|
||||
exit;
|
||||
$order = self::store($data);
|
||||
$invoice = Invoices::saveInvoice($order->id, $data);
|
||||
return $order ? OrderDetails::saveBasket($order->id, $basket) : false;
|
||||
}
|
||||
|
||||
@@ -42,4 +45,18 @@ class Orders
|
||||
{
|
||||
return Order::destroy($id);
|
||||
}
|
||||
|
||||
public static function getStatus($id)
|
||||
{
|
||||
return self::statuses()[$id] ?? false;
|
||||
}
|
||||
|
||||
public static function statuses()
|
||||
{
|
||||
return [
|
||||
'En attente',
|
||||
'Expédié',
|
||||
'Livré',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user