public static function getLogos($arr) { if (!$arr) { return null; } foreach ($arr as $value) { $logos[] = Logo::getLogo($value); } if (isset($logos)) { return $logos; } else { return null; } }
$imgPath = $history->img; $filePath = ".." . $imgPath . ".txt"; if (is_file($filePath)) { /** * 处理完毕,更新数据库 */ $file = fopen($filePath, "r"); if ($file) { $logoName = fgets($file); if ($logoName) { $logoName = trim(substr($logoName, 2)); //根据logoName获取logoId $sql = "select * from " . TABLE_LOGO . " where `img`='{$logoName}' OR `moreImg` LIKE '{$logoName}'"; $result = $mysql->query($sql); $value = $mysql->fetcharray($result); $logo = Logo::getLogo($value); } else { $logo = new Logo(-1, null, null, null, null, null); } if ($logo) { $sql = "UPDATE `" . TABLE_HISTORY . "` SET `logoId`={$logo->id},`isProcessing`=0 WHERE `id`={$history->id}"; $mysql->query($sql); $affetctRows = $mysql->affectedrows(); if ($affetctRows > 0) { $history->logoId = $logo->id; $history->processing = 0; } } } fclose($file); /**