dever 5 年之前
父节点
当前提交
ff5b7ad63a
共有 1 个文件被更改,包括 11 次插入16 次删除
  1. 11 16
      lib/Manage.php

+ 11 - 16
lib/Manage.php

@@ -182,25 +182,20 @@ class Manage
             $head .= '</tr></thead>';
 
             if ($option) {
-                $option = Dever::cartesian($option, function($option, $index)
-                {
-                    print_r($option);die;
-                    $html = '<tr data-row="' .($index+1). '">';
+                $option = Dever::cartesian($option);
 
-                    foreach ($option['name'] as $k => $v) {
+                foreach ($option as $k => $v) {
+                    $body .= '<tr data-row="' .($k+1). '">';
+
+                    foreach ($v['name'] as $k => $v) {
                         $rows = 1;
-                        $html .= '<td width="50" rowspan="'.$rows.'">'.$v.'</td>';
+                        $body .= '<td width="50" rowspan="'.$rows.'">'.$v.'</td>';
                     }
-                    $html .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
-                    $html .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
-                    $html .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
-                    $html .= '</tr>';
-                    return $html;
-                });
-
-                print_r($option);die;
-
-                $body .= implode('', $option);
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
+                    $body .= '<td width="30"><input type="text" class="layui-input" name="price[]" /></td>';
+                    $body .= '</tr>';
+                }
             }
 
             $body .= '</tbody>';