|
@@ -340,7 +340,7 @@ class Sku
|
|
|
$sku_value = array();
|
|
|
if ($other) {
|
|
|
$other_col = $other . '_id';
|
|
|
- $sku_value = Dever::db($other . '/goods_sku')->getData(array('goods_id' => $info['id'], $other_col => $other_id));
|
|
|
+ $sku_value = Dever::db($other . '/goods_sku')->getData(array('goods_id' => $info['id'], $other_col => $other_id, 'state_1' => 1));
|
|
|
|
|
|
$input = '<input type="hidden" name="goods_id" value="'.$info['id'].'"/><input type="hidden" name="'.$other_col.'" value="'.$other_id.'"/>';
|
|
|
}
|
|
@@ -465,7 +465,9 @@ class Sku
|
|
|
$key[] = $v['info_id'][$k1] . '-' . $v['id'][$k1];
|
|
|
}
|
|
|
$key = implode('_', $key);
|
|
|
- if (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
+ if (!isset($sku[$key])) {
|
|
|
+ unset($group_attr[$k]);
|
|
|
+ } elseif (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
unset($group_attr[$k]);
|
|
|
}
|
|
|
}
|
|
@@ -526,7 +528,7 @@ class Sku
|
|
|
|
|
|
$body .= $input;
|
|
|
|
|
|
- $html = $head . $body;
|
|
|
+ $html = $prefix . $head . $body;
|
|
|
|
|
|
if ($update) {
|
|
|
$html = '<table class="layui-table">' . $html . '</table>';
|
|
@@ -537,14 +539,16 @@ class Sku
|
|
|
if ($single_attr && $sku_value) {
|
|
|
foreach ($single_attr as $k => $v) {
|
|
|
$key = $v['info_id'] . '-' . $v['id'];
|
|
|
- if (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
+ if (!isset($sku[$key])) {
|
|
|
+ unset($single_attr[$k]);
|
|
|
+ } elseif (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
unset($single_attr[$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($single_attr) {
|
|
|
- $html = $prefix . $html;
|
|
|
+ $html = $html;
|
|
|
foreach ($single_attr as $k => $v) {
|
|
|
|
|
|
$id = array();
|
|
@@ -593,14 +597,16 @@ class Sku
|
|
|
}
|
|
|
|
|
|
if ($input_attr && $sku_value) {
|
|
|
- print_r($input_attr);die;
|
|
|
+
|
|
|
foreach ($input_attr as $k => $v) {
|
|
|
$key = array();
|
|
|
foreach ($v['option'] as $k1 => $v1) {
|
|
|
$key[] = $v1['price_key'];
|
|
|
}
|
|
|
$key = implode('_', $key);
|
|
|
- if (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
+ if (!isset($sku[$key])) {
|
|
|
+ unset($input_attr[$k]);
|
|
|
+ } elseif (isset($sku[$key]) && !isset($sku_value[$sku[$key]['id']])) {
|
|
|
unset($input_attr[$k]);
|
|
|
}
|
|
|
}
|