Ejemplo n.º 1
0
 public static function getJsons($arr)
 {
     if (!$arr) {
         return null;
     }
     $historys = History::getHistorys($arr);
     if ($historys) {
         return json_encode($historys, JSON_UNESCAPED_UNICODE);
     } else {
         return "[]";
     }
 }
Ejemplo n.º 2
0
include_once "utils/MySql.php";
include_once "model/History.php";
include_once "model/Logo.php";
define("QUERY_STATE", "SELECT * FROM " . TABLE_HISTORY . " WHERE `id` IN");
if (is_array($_GET) && count($_GET) > 0) {
    if (isset($_GET["ids"])) {
        $ids = $_GET["ids"];
    }
}
if (!isset($ids)) {
    echo "请求参数错误";
} else {
    $mysql = new MySql();
    $result = $mysql->query(QUERY_STATE . "(" . $ids . ")");
    $arr = $mysql->fetchall($result);
    $histories = History::getHistorys($arr);
    if ($histories) {
        foreach ($histories as $history) {
            if (!$history->logoId) {
                /**
                 * 查看是否处理完毕
                 */
                $imgPath = $history->img;
                $filePath = ".." . $imgPath . ".txt";
                if (is_file($filePath)) {
                    /**
                     * 处理完毕,更新数据库
                     */
                    $file = fopen($filePath, "r");
                    if ($file) {
                        $logoName = fgets($file);