dever 3 年之前
父節點
當前提交
9bafe8b399
共有 3 個文件被更改,包括 15 次插入12 次删除
  1. 2 2
      app/goods/database/info.php
  2. 4 7
      app/goods/lib/Info.php
  3. 9 3
      app/goods/lib/Sku.php

+ 2 - 2
app/goods/database/info.php

@@ -295,7 +295,7 @@ $config = array
             //'update'    => 'radio',
             'option'    => $yes,
             //'list'      => true,
-            'edit'      => true,
+            //'edit'      => true,
         ),
 
         'content'       => array
@@ -389,7 +389,7 @@ $config = array
         ),
         //'insert' => false,
         //'delete' => false,
-        'mul' => true,
+        //'mul' => true,
         # 自定义快捷新增和编辑
         'button' => array
         (

+ 4 - 7
app/goods/lib/Info.php

@@ -396,6 +396,10 @@ class Info
                     }
                 }
             }
+
+            if (isset($info['price']['min']['price'])) {
+                $info['price']['value'] = $info['price']['min']['price'];
+            }
         } else {
             $price = $info['price'];
             $s_price = $info['s_price'];
@@ -409,13 +413,6 @@ class Info
             $info['price']['value'] = $price;
             $info['price']['max'] = array();
         }
-
-        if (isset($info['price']['min']['price'])) {
-            $info['price']['value'] = $info['price']['min']['price'];
-        } else {
-            $info['price']['value'] = 0;
-        }
-        
        
         if (isset($info['cdate']) && $info['cdate']) {
             $info['cdate_string'] = Dever::mdate($info['cdate'], 2);

+ 9 - 3
app/goods/lib/Sku.php

@@ -228,8 +228,9 @@ class Sku
             if (!$update && $col_num <= 1) {
                 $head = '';
             }
-
-            $input .= '<input type="hidden" name="key" value="-1"/>';
+            if ($update) {
+                $input .= '<input type="hidden" name="key" value="-1"/>';
+            }
 
             $body .= '<tr>';
 
@@ -265,6 +266,8 @@ class Sku
             
             $option = Dever::cartesian($option);
 
+            $show = false;
+
             foreach ($option as $k => $v) {
                 $body .= '<tr data-row="' .($k+1). '">';
 
@@ -307,7 +310,10 @@ class Sku
                     }
                 }
 
-                $body .= '<input type="hidden" name="key['.$k.']" value="'.$key.'"/><textarea style="display:none;" name="attr['.$k.']">'.json_encode($id).'</textarea>';
+                if ($update) {
+                    $body .= '<input type="hidden" name="key['.$k.']" value="'.$key.'"/><textarea style="display:none;" name="attr['.$k.']">'.json_encode($id).'</textarea>';
+                }
+                
                 $body .= '</tr>';
             }
         }