<?php
//拉杆总成
$maxInsertRowsCount = 0;
if ($item['pos2'] == 'L/R' || $item['pos2'] == '') {
    $style = [
        'image' => [
            'col' => 3,
            'top' => true,
            'offsetX' => 32,
            'height' => 80,
        ],
    ];
    $skips[] = $currentKey;
    $back = $this->insertAny($sheet, $this->rowNum, $item, $style);
    if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
    $style = [
        'image' => [
            'col' => false,
            'top' => true,
            'offsetX' => 32,
            'height' => 80,

            'flip' => true,
            'flipCol' => 7,
            'flipOffsetX' => 32,
        ],
    ];
    $back = $this->insertAny($sheet, $this->rowNum, $item, $style);
    if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
}
if ($item['pos2'] == 'L') {
    $style = [
        'image' => [
            'col' => 3,
            'top' => true,
            'offsetX' => 32,
            'height' => 80,
        ],
    ];
    $skips[] = $currentKey;
    $back = $this->insertAny($sheet, $this->rowNum, $item, $style);
    if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
    //找 右
    if ($newItem = $this->findRight($items, $item, $skips)) {
        $style = [
            'image' => [
                'col' => 7,
                'top' => true,
                'offsetX' => 0,
                'height' => 80,
            ],
        ];
        $back = $this->insertAny($sheet, $this->rowNum, $newItem, $style);
        if ($back > $maxInsertRowsCount) $maxInsertRowsCount = $back;
    }
}
