large commit

This commit is contained in:
Omair Saleh
2019-10-16 12:30:54 +08:00
parent b164b189f7
commit 6a91664c9d
@@ -34,22 +34,20 @@ class ListsOrderHistory
$this->history->push(['type' => 1, 'date' => $createdAt->format('d-m-Y'), 'description' => 'Order number has been created']);
$warehouse_id = OrderWarehouse::where('order_id', $orderId)->first()->warehouse_id;
$warehouse = Warehouse::where('id', $warehouse_id)->first();
foreach ($orderSteps as $step){
$completeDate = Carbon::parse($step->complete_date)->format('d-m-Y');
switch ($step->reference_id){
case OrderSteps::ORDER_PROCESSING_STEP:
$warehous = OrderWarehouse::where('order_id', $orderId)->first();
if($warehous){
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => Warehouse::where('id', $warehous->warehouse_id)->first()->name.' confirmed as your order\'s warehouse']);
if($warehouse_id){
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => $warehouse->name.' confirmed as your order\'s warehouse']);
}
break;
case OrderSteps::ORDER_NO_WAREHOUSE_PENDING_SUPPLIER:
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Your Order has been loaded into container']);
break;
case OrderSteps::ORDER_WAREHOUSE_RECEIVING_STEP:
$warehouseId = OrderWarehouse::where('order_id', $order->id)->where('type', 0)->first()->pluck('warehouse_id');
$warehouse = Warehouse::where('id', $warehouseId)->first();
$this->history->push(['type' => 1, 'date' => $completeDate, 'description' => 'Arrived at '. $warehouse->name .' warehouse in china']);
break;
case OrderSteps::ORDER_WAREHOUSE_PACKING_STEP: