Explorar o código

修改村务考室生成表格(自动) word

sandm %!s(int64=2) %!d(string=hai) anos
pai
achega
a1bf7f7e2b
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      app/Http/Controllers/Web/Talent/JjhcController.php

+ 3 - 3
app/Http/Controllers/Web/Talent/JjhcController.php

@@ -79,9 +79,9 @@ class JjhcController extends WebBaseController
             $word->cloneRow('id', $rows);//复制行
             for ($i = 0; $i < $rows; $i++) {
                 $word->setValue("id#" . ($i + 1), $i + 1);//替换变量
-                $word->setValue("realname#" . ($i + 1), $list[$i]['realname']);
-                $word->setValue("ex_number#" . ($i + 1), $list[$i]['ex_number']);
-                $word->setValue("ex_seat#" . ($i + 1), $list[$i]['ex_seat']);
+                $word->setValue("realname#" . ($i + 1), $list[$i]->realname);
+                $word->setValue("ex_number#" . ($i + 1), $list[$i]->ex_number);
+                $word->setValue("ex_seat#" . ($i + 1), $list[$i]->ex_seat);
             }
             $word->saveAs(base_path() ."/excel/cunwu{$room}.docx");//另存为
         }