This commit is contained in:
WispX
2019-01-01 13:31:45 +08:00
parent b6156bcd08
commit 44c16fece2
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -242,9 +242,12 @@ EOT;
}
}
if (!$mysqli->multi_query($file)) {
throw new Exception('数据写入失败');
foreach (explode(';', $file) as $item) {
if ($item && !$mysqli->query($item . ';')) {
throw new Exception('数据写入失败');
}
}
$mysqli->commit();
$mysqli->autocommit(true);
$mysqli->close();
@@ -48,7 +48,7 @@ class Images extends Base
]
])->each(function ($item) {
$item->username = Users::where('id', $item->user_id)->value('username');
$item->strategyStr = $this->strategyList[$item->strategy]['name'];
$item->strategyStr = isset($this->strategyList[$item->strategy]) ? $this->strategyList[$item->strategy]['name'] : '未知';
return $item;
});
$this->assign([