Due to the widespread usage of Internet of things devices in online-to-offline businesses, a huge volume of data from heterogeneous data sources are collected and transferred to the data processing components in online-to-offline systems. This leads to increased complexity in data storage and querying, especially for spatial-temporal data processing in online-to-offline systems. In this article, first, we design a multi-layer Internet of things database schema to meet the diverse requirements through fusing spatial data with texts, images, and videos transferred from the sensors of the Internet of things networks. The proposed multi-layer Internet of things database schema includes logical nodes, geography nodes, storage nodes, and application nodes. These data nodes cooperate with each other to facilitate the data storing, indexing, and querying. Second, a searching algorithm is designed based on pruning strategy. The complexity of the algorithm is also analyzed. Finally, the multi-layer Internet of things database schema and its application are illustrated in a smart city construction project in Shanghai, China, recommending available charging points to the customers who need to charge their electric energy-driven cars.