изменение метров в сантиметры
This commit is contained in:
parent
f57d7f6460
commit
bfb0fbe4de
|
@ -68,9 +68,9 @@ class Dellin extends Model
|
|||
* @param int $from Идентификатор терминала Dellin
|
||||
* @param int $to Идентификатор терминала Dellin
|
||||
* @param int $weight Вес (кг)
|
||||
* @param int $x Ширина (м)
|
||||
* @param int $y Высота (м)
|
||||
* @param int $z Длинна (м)
|
||||
* @param int $x Ширина (cм)
|
||||
* @param int $y Высота (cм)
|
||||
* @param int $z Длинна (cм)
|
||||
* @param int $amount Количество
|
||||
* @param Account|int|null $account Аккаунт
|
||||
*
|
||||
|
@ -96,6 +96,11 @@ class Dellin extends Model
|
|||
if (empty($z) || $z === 0) $z = 25;
|
||||
if (empty($weight) || $weight === 0) $weight = 300;
|
||||
|
||||
// Конвертация из сантиметров в метры
|
||||
$x /= 100;
|
||||
$y /= 100;
|
||||
$z /= 100;
|
||||
|
||||
// Вычисление самой крупной стороны, так как ДеловыеЛинии имеют ограничения на все три поля и у длинны оно больше всех
|
||||
if ($x > $z && $x > $y) {
|
||||
// "X" больше всех
|
||||
|
|
|
@ -157,7 +157,7 @@ use app\models\Search;
|
|||
<section id="prod_<?= $model['catn'] ?>_info" class="col">
|
||||
<!-- Габариты -->
|
||||
<p class="form-control-sm p-0 h-auto">
|
||||
<b>Габариты:</b><span id="prod_<?= $model['catn'] ?>_dmns_x" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'x');"><?= empty($model['dmns']['x']) ? '0' : $model['dmns']['x'] ?></span><span class="mr-1">м</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_y" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'y');"><?= empty($model['dmns']['y']) ? '0' : $model['dmns']['y'] ?></span><span class="mr-1">м</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_z" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'z');"><?= empty($model['dmns']['z']) ? '0' : $model['dmns']['z'] ?></span><span class="mr-1">м</span>
|
||||
<b>Габариты:</b><span id="prod_<?= $model['catn'] ?>_dmns_x" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'x');"><?= empty($model['dmns']['x']) ? '0' : $model['dmns']['x'] ?></span><span class="mr-1">см</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_y" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'y');"><?= empty($model['dmns']['y']) ? '0' : $model['dmns']['y'] ?></span><span class="mr-1">см</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_z" class="ml-1 pointer-event" role="button" onclick="return product_panel_dimensions_edit('<?= $model['catn'] ?>', '<?= $model['prod'] ?>', this, 'z');"><?= empty($model['dmns']['z']) ? '0' : $model['dmns']['z'] ?></span><span class="mr-1">см</span>
|
||||
</p>
|
||||
<!-- Вес -->
|
||||
<p class="form-control-sm p-0 h-auto">
|
||||
|
@ -168,7 +168,7 @@ use app\models\Search;
|
|||
<section id="prod_<?= $model['catn'] ?>_info" class="col mb-1">
|
||||
<!-- Габариты -->
|
||||
<p class="form-control-sm p-0 h-auto">
|
||||
<b>Габариты:</b><span id="prod_<?= $model['catn'] ?>_dmns_x" class="ml-1"><?= empty($model['dmns']['x']) ? '0' : $model['dmns']['x'] ?></span><span class="mr-1">м</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_y" class="ml-1"><?= empty($model['dmns']['y']) ? '0' : $model['dmns']['y'] ?></span><span class="mr-1">м</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_z" class="ml-1"><?= empty($model['dmns']['z']) ? '0' : $model['dmns']['z'] ?></span><span class="mr-1">м</span>
|
||||
<b>Габариты:</b><span id="prod_<?= $model['catn'] ?>_dmns_x" class="ml-1"><?= empty($model['dmns']['x']) ? '0' : $model['dmns']['x'] ?></span><span class="mr-1">см</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_y" class="ml-1"><?= empty($model['dmns']['y']) ? '0' : $model['dmns']['y'] ?></span><span class="mr-1">см</span><small>x</small><span id="prod_<?= $model['catn'] ?>_dmns_z" class="ml-1"><?= empty($model['dmns']['z']) ? '0' : $model['dmns']['z'] ?></span><span class="mr-1">см</span>
|
||||
</p>
|
||||
<!-- Вес -->
|
||||
<p class="form-control-sm p-0 h-auto">
|
||||
|
|
Reference in New Issue