Пример #1
0
 /**
  * 内部函数
  */
 protected function exec($insert = false)
 {
     //记录日志
     $this->query = $this->pdo->prepare($this->sql, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);
     $execute = $this->query->execute($this->value);
     $last_id = $this->pdo->lastInsertId();
     if (!$execute) {
         $info = $this->query->errorInfo()[2];
         Log::error("MYSQL query failed.sql:" . $this->sql) . " BindValue:" . json_encode($this->value) . " ErrorInfo:" . $info;
         return false;
     }
     Log::info("MYSQL query failed.sql:" . $this->sql) . " BindValue:" . json_encode($this->value) . " ErrorInfo:" . $info;
     return $last_id ?: null;
 }
function log_clean()
{
    return Log::clean();
}