get(); foreach ($options as &$option) { $options->withhold_stock = $option->withhold_stock; } $specs = []; $html = ''; if (count($options) > 0) { $specitemids = explode("_", $options[0]['specs']); foreach ($specitemids as $itemid) { foreach ($allSpecs as $spec) { $specItems = $spec['items']; foreach ($specItems as $specItem) { if ($specItem['id'] == $itemid) { $specs[] = $spec; break; } } } } $html .= '
| " . $specs[$i]['title'] . " | "; $itemlen = count($specs[$i]['items']); if ($itemlen <= 0) { $itemlen = 1; } $newlen *= $itemlen; $h = array(); for ($j = 0; $j < $newlen; $j++) { $h[$i][$j] = []; } $l = count($specs[$i]['items']); $rowspans[$i] = 1; for ($j = $i + 1; $j < $specs_len; $j++) { $rowspans[$i] *= count($specs[$j]['items']); } } $html .= ''; $html .= ' | 预扣库存 | ';
$html .= ''; $html .= ' | '; $html .= ' | '; //$html .= ' | '; $html .= ' | '; $html .= ' | '; $html .= ' | '; $html .= ' | '; $html .= ' | 点击图片上传 推荐(100*100) | ';
$html .= '" . $specs[$m]['items'][$kid]['title'] . " | ", "id" => $specs[$m]['items'][$kid]['id'] ); } else { $h[$m][$j] = array( "html" => "", "id" => $specs[$m]['items'][$kid]['id'] ); } $n++; if ($n == $rowspan) { $kid++; if ($kid > count($specs[$m]['items']) - 1) { $kid = 0; } $n = 0; } } } $hh = ""; for ($i = 0; $i < $newlen; $i++) { $hh .= "
|---|---|---|---|---|---|---|---|---|---|---|---|
| '; $hh .= ''; $hh .= ''; $hh .= ''; $hh .= ''; $hh .= ''; $hh .= ' | '; //$hh .= ''; $hh .= ' | '; $hh .= ' | '; $hh .= ''; $hh .= ' | '; $hh .= ''; $hh .= ' | '; //$hh .= ' | '; $hh .= ' | '; $hh .= ' | '; $hh .= ' | '; $hh .= ' | '; $hh .= ' |