|
|
@@ -41,6 +41,8 @@ namespace common\models; |
|
|
|
use common\helpers\Debug; |
|
|
|
use common\helpers\GlobalParam; |
|
|
|
use common\helpers\Price; |
|
|
|
use common\models\Producer; |
|
|
|
use common\models\Producer; |
|
|
|
use Yii; |
|
|
|
use yii\helpers\Html; |
|
|
|
use common\models\Producer; |
|
|
@@ -644,21 +646,34 @@ class Order extends ActiveRecordCommon |
|
|
|
*/ |
|
|
|
public function getState() |
|
|
|
{ |
|
|
|
$orderDate = strtotime($this->distribution->date); |
|
|
|
$today = strtotime(date('Y-m-d')); |
|
|
|
$todayHour = date('G'); |
|
|
|
$dayDistribution = strtolower(date('l', strtotime($this->distribution->date))) ; |
|
|
|
|
|
|
|
$orderDelay = Producer::getConfig( |
|
|
|
'order_delay', |
|
|
|
$this->distribution->id_producer |
|
|
|
); |
|
|
|
$orderDelaySpecific = Producer::getConfig( |
|
|
|
'order_delay_'.$dayDistribution, |
|
|
|
$this->distribution->id_producer |
|
|
|
); |
|
|
|
if($orderDelaySpecific) { |
|
|
|
$orderDelay = $orderDelaySpecific ; |
|
|
|
} |
|
|
|
|
|
|
|
$orderDeadline = Producer::getConfig( |
|
|
|
'order_deadline', |
|
|
|
$this->distribution->id_producer |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$orderDate = strtotime($this->distribution->date); |
|
|
|
$today = strtotime(date('Y-m-d')); |
|
|
|
$todayHour = date('G'); |
|
|
|
$orderDeadlineSpecific = Producer::getConfig( |
|
|
|
'order_deadline_'.$dayDistribution, |
|
|
|
$this->distribution->id_producer |
|
|
|
); |
|
|
|
if($orderDeadlineSpecific) { |
|
|
|
$orderDeadline = $orderDeadlineSpecific ; |
|
|
|
} |
|
|
|
|
|
|
|
$nbDays = (int) round((($orderDate - $today) / (24 * 60 * 60))); |
|
|
|
|