Przeglądaj źródła

[producer] Correctifs divers

dev
Guillaume 4 lat temu
rodzic
commit
e5e98bd533
2 zmienionych plików z 5 dodań i 4 usunięć
  1. +5
    -3
      common/models/Order.php
  2. +0
    -1
      producer/controllers/OrderController.php

+ 5
- 3
common/models/Order.php Wyświetl plik

@@ -653,12 +653,14 @@ class Order extends ActiveRecordCommon
'order_deadline',
$this->distribution->id_producer
);

$orderDate = strtotime($this->distribution->date);
$today = strtotime(date('Y-m-d'));
$todayHour = date('G');

$nbDays = (int)(($orderDate - $today) / (24 * 60 * 60));
$nbDays = (int) round((($orderDate - $today) / (24 * 60 * 60)));

if ($nbDays <= 0) {
return self::STATE_DELIVERED;
@@ -667,7 +669,7 @@ class Order extends ActiveRecordCommon
($nbDays == $orderDelay && $todayHour < $orderDeadline))) {
return self::STATE_OPEN;
}
return self::STATE_PREPARATION;
}

@@ -873,4 +875,4 @@ class Order extends ActiveRecordCommon
return $username ;
}

}
}

+ 0
- 1
producer/controllers/OrderController.php Wyświetl plik

@@ -437,7 +437,6 @@ class OrderController extends ProducerBaseController

if ($order && User::getCurrentId() == $order->id_user) {
$order->delete();
$order->changeOrderStatus('canceled', 'user');
Yii::$app->session->setFlash('success', 'Votre commande a bien été annulée.');
}


Ładowanie…
Anuluj
Zapisz