foreach (range(1, 5) as $ind) {
$weekStart = date("Y-m-d 00:00:00", strtotime("+" . (($ind - 1) * 7) . ' days', strtotime($monthStart)));
- $weekEnd = date("Y-m-d 23:50:50", strtotime("+" . ($ind * 7 - 1) . ' days', strtotime($monthStart)));
+ $weekEnd = date("Y-m-d 23:59:59", strtotime("+" . ($ind * 7 - 1) . ' days', strtotime($monthStart)));
if ($weekEnd > $monthEnd) {
$weekEnd = $monthEnd;
}
$motivationValue->save();
//var_dump($motivationValue); die;
if ($motivationValue->getErrors()) {
- var_dump($motivationValue->getErrors());
- die;
+ throw new \Exception(Json::encode($motivationValue->getErrors()));
}
}
$motivationValue->value_float = $salesProduct['total'];
$motivationValue->save();
if ($motivationValue->getErrors()) {
- var_dump($motivationValue->getErrors());
- die;
+ throw new \Exception(Json::encode($motivationValue->getErrors()));
}
}
}