restart
This commit is contained in:
@@ -9,13 +9,24 @@ class Orders
|
||||
|
||||
public static function saveOrder($data)
|
||||
{
|
||||
$data += $data['basket'];
|
||||
$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;
|
||||
$detail = OrderDetails::saveBasket($order->id, $basket['detail']);
|
||||
unset($data['comment']);
|
||||
unset($data['agree']);
|
||||
unset($data['customer_id']);
|
||||
unset($data['delivery_id']);
|
||||
unset($data['detail']);
|
||||
unset($data['payment_type']);
|
||||
unset($data['sale_channel_id']);
|
||||
return ($order && $detail) ? Invoices::saveInvoice($order->id, $data) : false;
|
||||
}
|
||||
|
||||
public static function edit($id)
|
||||
{
|
||||
return Orders::get($id, ['customer', 'address', 'delivery', 'detail']);
|
||||
}
|
||||
|
||||
public static function get($id, $relations = false)
|
||||
@@ -30,6 +41,7 @@ class Orders
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
OrderStats::increase();
|
||||
return Order::create($data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user