当前位置:首页>python>使用 Python 绘制带邻国地区的中国地图

使用 Python 绘制带邻国地区的中国地图

  • 2026-06-29 13:01:29
使用 Python 绘制带邻国地区的中国地图

由于借助 AI 工具学习编程已经变得非常容易了,因此之后的课程就不再默认进行视频讲解了,如果特别需要视频讲解也可以联系李老师预约讲解~讲义材料学习过程中遇到的问题也可以及时与李老师联系。

在之前「使用 ggplot2 绘制地图——以中国地图为例」课程的基础上,我们今天再来学习下如何使用 Python 的 matplotlib 把邻国的区域也添加到中国地图上:

小地图版本
长版

使用 reticulate 创建与管理 Python 虚拟环境

在 R 中通过 reticulate 包来调用 Python,最好的实践是为项目创建一个专属的 Python 虚拟环境,将所需依赖隔离到独立空间,避免与系统 Python(如 Anaconda)发生版本冲突。

重要说明(避免"已初始化"报错):reticulate 在 R 会话中只能绑定一次 Python——一旦某个 {python} 代码块运行,Python 解释器就被锁定,之后再调用 use_virtualenv() 会报错:

ERROR: The requested version of Python cannot be used, as another version has already been initialized.

因此,虚拟环境的激活必须在所有 {python} 代码块之前完成。本文档的解决方案是在 setup chunk 中通过 Sys.setenv(RETICULATE_PYTHON = ...) 提前锁定 Python 路径,这是 reticulate 选取 Python 的最高优先级入口。

安装 reticulate(仅首次)

options(repos = c(CRAN = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
if (!requireNamespace("reticulate"quietly = TRUE)) {
  install.packages("reticulate")
  message("reticulate 安装完成!")
else {
  message("reticulate 已安装,版本:", packageVersion("reticulate"))
}

虚拟环境初始化原理(已在 setup chunk 中完成)

本文档的 setup chunk(隐藏运行)包含如下逻辑:

library(reticulate)
.venv_name   <-".venv"
.venv_python <- virtualenv_python(.venv_name)
if(!file.exists(.venv_python)){
  virtualenv_create(.venv_name)
  .venv_python <- virtualenv_python(.venv_name)
}
Sys.setenv(RETICULATE_PYTHON = .venv_python)
use_virtualenv(.venv_name, required =TRUE)

这样做的关键在于:knitr 在处理第一个 {python} chunk 时,reticulate 已经通过 RETICULATE_PYTHON 环境变量知道要使用 .venv,不会再去碰 Anaconda。

在虚拟环境中安装 Python 包(仅首次)

py_pkgs <- c(
"numpy""pandas""geopandas""matplotlib",
"shapely""openpyxl"
)
installed <- py_list_packages(".venv")$package
need_install <- setdiff(py_pkgs, installed)
if (length(need_install) > 0) {
  virtualenv_install(".venv", packages = need_install)
  message("已安装缺失的包:"paste(need_install, collapse = ", "))
else {
  message("所有 Python 包已就绪,无需安装")
}

验证激活状态

py_config()

查看已安装的包

pkgs <- py_list_packages(".venv")
key_pkgs <- c("numpy""pandas""geopandas""matplotlib""shapely""openpyxl")
pkgs[pkgs$package %in% key_pkgs, c("package""version")]

虚拟环境管理常用命令

virtualenv_list()
virtualenv_remove(".venv")  # 删除虚拟环境
virtualenv_install(".venv", packages = "geopandas", ignore_installed = TRUE)  # 升级某个包

小地图版本

1. 在地图上添加散点

首先加载所需 Python 包,设置字体和坐标系:

import geopandas as gpd
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import matplotlib.font_manager as fm
from matplotlib.patches import Rectangle
from shapely.geometry import box, Point
import warnings
warnings.filterwarnings("ignore")
# 字体设置
font_path = "LXGWWenKai-Regular.ttf"
font_prop = fm.FontProperties(fname=font_path)
fm.fontManager.addfont(font_path)
plt.rcParams["font.family"] = font_prop.get_name()
plt.rcParams["axes.unicode_minus"] = False
# 中国地图投影坐标系
MYCRS = (
"+proj=aea +lat_0=0 +lon_0=105 +lat_1=25 +lat_2=47 "
"+x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"
)

然后读取地图数据和散点数据:

# 绘图区域(预设好的 bbox)
plot_bbox = box(-2725586180065529827686000000)
plot_bbox_gdf = gpd.GeoDataFrame(geometry=[plot_bbox], crs=MYCRS)
# 读取小地图版本的中国城市地图
citymap = gpd.read_file("chinacity2019mini/chinacity2019mini.shp")
citymap = citymap[citymap["省代码"].notna()].copy()
citymap = citymap.to_crs(MYCRS)
# 线条(九段线、海岸线、小地图框格)
citylinemap_all = gpd.read_file("chinacity2019mini/chinacity2019mini_line.shp")
citylinemap_all = citylinemap_all.to_crs(MYCRS)
citylinemap = citylinemap_all[
    citylinemap_all["class"].isin(["九段线""海岸线""小地图框格"])
].copy()

在之前课程的基础上,我们还需要读取一份邻国地图数据:

# 邻国地图
china_neighboring = gpd.read_file("china_neighboring/china_neighboring.shp")
china_neighboring = china_neighboring.to_crs(MYCRS)

读取企业散点数据,并将经纬度坐标转换为投影坐标:

# 读取瞪羚、独角兽、创新型企业经纬度数据
pointdf = pd.read_excel("瞪羚、独角兽、创新型企业经纬度数据.xlsx")
pointdf = pointdf[pointdf["经度"].notna()].copy()
print(f"数据量:{len(pointdf)} 条")
# 转换成 GeoDataFrame(WGS84 → 投影坐标)
pointdfsf = gpd.GeoDataFrame(
    pointdf,
    geometry=gpd.points_from_xy(pointdf["经度"], pointdf["纬度"]),
    crs="EPSG:4326"
)
pointdfsf = pointdfsf.to_crs(MYCRS)

接下来处理小地图框格内的散点——先提取小地图范围内的点,然后将其缩放并平移到小地图框格的位置:

# 小地图范围
small_bbox = box(1200003200001766004.12557786.0)
# 提取小地图范围内的点
pointdfsf_small = pointdfsf[pointdfsf.geometry.within(small_bbox)].copy()
print(f"小地图内散点数:{len(pointdfsf_small)}")
# 缩放 0.5 倍 + 平移(等价于 R 中 geometry * 0.5 + c(2100000, 1665139))
new_geoms = []
for geom in pointdfsf_small.geometry:
    new_geoms.append(Point(geom.x * 0.5 + 2100000, geom.y * 0.5 + 1665139))
pointdfsf_small = pointdfsf_small.copy()
pointdfsf_small = pointdfsf_small.set_geometry(new_geoms)
pointdfsf_small = pointdfsf_small.set_crs(MYCRS)
# 合并主地图散点 + 小地图散点
pointdfsfall = pd.concat([pointdfsf, pointdfsf_small], ignore_index=True)
pointdfsfall = gpd.GeoDataFrame(pointdfsfall, geometry="geometry", crs=MYCRS)

设置省份颜色表(对应 R 中 ggsci::default_igv)和线条样式:

# 省份颜色表(32 色,对应 ggsci::default_igv)
IGV_COLORS = [
"#5050FF""#CE3D32""#749B58""#F0E685""#466983""#B7DEE8",
"#70C4BF""#56B4E9""#E69F00""#009E73""#F0E442""#0072B2",
"#D55E00""#CC79A7""#999999""#FF7F00""#A6CEE3""#1F78B4",
"#B2DF8A""#33A02C""#FB9A99""#E31A1C""#FDBF6F""#FF7F00",
"#CAB2D6""#6A3D9A""#FFFF99""#B15928""#FBB4AE""#B3CDE3",
"#CCEBC5""#DECBE4",
]
province_list = sorted(pointdfsfall["省"].dropna().unique())
color_map = {prov: IGV_COLORS[i % len(IGV_COLORS)] for i, prov inenumerate(province_list)}
pointdfsfall["color"] = pointdfsfall["省"].map(color_map)
# 线条颜色与线宽
LINE_COLOR = {"九段线""#A29AC4""海岸线""#0055AA""小地图框格""black"}
LINE_WIDTH = {"九段线"0.6"海岸线"0.3"小地图框格"0.3}

然后就可以绘制散点地图了:

# 定义比例尺和指北针辅助函数
defadd_scale_bar(ax, ref_gdf, location="bl"):
    xlim = ax.get_xlim()
    ylim = ax.get_ylim()
    ax_w = xlim[1] - xlim[0]
    ax_h = ylim[1] - ylim[0]
# 固定 1000km
    bar_km = 1000
    bar_m = bar_km * 1000
    bar_h = ax_h * 0.016
    bar_x = xlim[0] + ax_w * 0.03
    bar_y = ylim[0] + ax_h * 0.05
    bar_w = bar_m
    segments = 4
    seg_w = bar_w / segments
for i inrange(segments):
        fc = "black"if i % 2 == 0else"white"
        rect = Rectangle(
            (bar_x + i * seg_w, bar_y), seg_w, bar_h,
            facecolor=fc, edgecolor="black", linewidth=0.6,
            clip_on=False, zorder=10
        )
        ax.add_patch(rect)
    ax.text(bar_x, bar_y - bar_h * 0.5"0",
            fontsize=9, ha="center", va="top", fontproperties=font_prop, zorder=11)
    ax.text(bar_x + bar_w, bar_y - bar_h * 0.5f"{bar_km} km",
            fontsize=9, ha="center", va="top", fontproperties=font_prop, zorder=11)
defadd_north_arrow(ax):
    xlim = ax.get_xlim()
    ylim = ax.get_ylim()
    ax_w = xlim[1] - xlim[0]
    ax_h = ylim[1] - ylim[0]
    x_center = xlim[1] - ax_w * 0.05
    y_base = ylim[1] - ax_h * 0.08
    arrow_len = ax_h * 0.06
    ax.annotate(
"", xy=(x_center, y_base + arrow_len), xytext=(x_center, y_base),
        arrowprops=dict(arrowstyle="-|>", color="black", lw=2), zorder=11
    )
    ax.text(x_center, y_base + arrow_len + ax_h * 0.015"N",
            fontsize=12, ha="center", va="bottom",
            fontweight="bold", fontproperties=font_prop, zorder=11)
此处代码需下载讲义材料查看~

2. 填充地图

下面我们再演示下填充地图的绘制。

首先统计每个城市的公司数量,并与地图数据合并:

citydf = pointdf.groupby(["市""市代码"]).size().reset_index(name="n")
citymap2 = citymap.merge(citydf, on=["市""市代码"], how="left")
citymap2["n"] = citymap2["n"].fillna(0).astype(int)
print(citymap2["n"].describe())

然后绘制连续填充地图:

n = n + 1 是为了对数化之后 0 变成 -Inf,在图上会反映为缺失值。

此处代码需下载讲义材料查看~

也可以使用分段填色:

# 计算分位数断点
cutlist_raw = np.quantile(citymap2["n"].values, np.arange(111) / 10)
cutlist = sorted(set(cutlist_raw.astype(int).tolist()))
labels_c = ["<= 1""1~3""3~9""9~18""19~39""39~92"">= 92"]
citymap3 = citymap2.copy()
citymap3["group"] = pd.cut(
    citymap3["n"], bins=cutlist,
    labels=labels_c[: len(cutlist) - 1],
    include_lowest=True
)
print(citymap3["group"].value_counts().sort_index())
# 离散色阶(使用 inferno_r 的 0~0.95 范围)
n_cats = len(labels_c)
acton_colors = [CMAP_ACTON(i / (n_cats - 1) * 0.95for i inrange(n_cats)]
cat_color_map = dict(zip(labels_c, acton_colors))
fig, ax = plt.subplots(figsize=(11.58.5))
plot_bbox_gdf.plot(ax=ax, color="#BBD1EB", zorder=1)
# 逐组绘制省份
for label in labels_c:
    subset = citymap3[citymap3["group"] == label]
iflen(subset) > 0:
        subset.plot(
            ax=ax, facecolor=cat_color_map[label],
            edgecolor="gray", linewidth=0.01, zorder=2
        )
# 未分组(NaN)用白色
citymap3[citymap3["group"].isna()].plot(
    ax=ax, facecolor="white", edgecolor="gray", linewidth=0.01, zorder=2
)
china_neighboring.plot(ax=ax, facecolor="#EDEDED", edgecolor="none", zorder=3)
for _, row in china_neighboring.iterrows():
    centroid = row.geometry.centroid
    ax.text(
        centroid.x, centroid.y, row["country_cn"],
        fontsize=8, color="gray", ha="center", va="center",
        fontproperties=font_prop, zorder=6
    )
for cls in ["九段线""海岸线""小地图框格"]:
    subset = citylinemap[citylinemap["class"] == cls]
iflen(subset) > 0:
        subset.plot(ax=ax, color=LINE_COLOR[cls], linewidth=LINE_WIDTH[cls], zorder=4)
ax.scatter(
    pointdfsfall.geometry.x, pointdfsfall.geometry.y,
    c=pointdfsfall["color"], s=0.3, linewidths=0, zorder=5
)
ax.set_aspect("equal")
ax.set_xlim(plot_bbox_gdf.total_bounds[0], plot_bbox_gdf.total_bounds[2])
ax.set_ylim(plot_bbox_gdf.total_bounds[1], plot_bbox_gdf.total_bounds[3])
xlim = ax.get_xlim()
ylim = ax.get_ylim()
ax_w = xlim[1] - xlim[0]
ax_h = ylim[1] - ylim[0]
# 手动绘制分类图例(左下角,两列排列,从上到下、从左到右)
legend_x = xlim[0] + ax_w * 0.03
legend_y = ylim[0] + ax_h * 0.10
sq_size = ax_h * 0.032
gap = ax_h * 0.040
n_cols = 2
col_offset = ax_w * 0.15
n_rows_per_col = (len(labels_c) + n_cols - 1) // n_cols
此处代码需下载讲义材料查看~

长版地图

长版地图的绘制更简单一些,这里演示省级分段填充地图的绘制。

首先读取长版省级地图、线条和邻国数据:

# 长版绘图区域
long_bbox = box(-2925762.0377031.12507277.86221888.6)
long_bbox_gdf = gpd.GeoDataFrame(geometry=[long_bbox], crs=MYCRS)
# 读取长版省级地图
provmap = gpd.read_file("chinaprov2021long/chinaprov2021long.shp")
provmap = provmap[provmap["省代码"].notna()].copy()
provmap = provmap.to_crs(MYCRS)
# 线条(长版无小地图框格)
provlinemap_all = gpd.read_file("chinaprov2021long/chinaprov2021long_line.shp")
provlinemap_all = provlinemap_all.to_crs(MYCRS)
provlinemap = provlinemap_all[
    provlinemap_all["class"].isin(["九段线""海岸线"])
].copy()
# 邻国地图(长版)
china_neighboring_long = gpd.read_file("china_neighboring_long/china_neighboring_long.shp")
china_neighboring_long = china_neighboring_long.to_crs(MYCRS)

读取散点数据并汇总统计每个省份的企业数量:

# 读取散点数据
pointdf = pd.read_excel("瞪羚、独角兽、创新型企业经纬度数据.xlsx")
pointdf = pointdf[pointdf["经度"].notna()].copy()
pointdfsf = gpd.GeoDataFrame(
    pointdf,
    geometry=gpd.points_from_xy(pointdf["经度"], pointdf["纬度"]),
    crs="EPSG:4326"
)
pointdfsf = pointdfsf.to_crs(MYCRS)
# 省份颜色
province_list_long = sorted(pointdfsf["省"].dropna().unique())
color_map_long = {prov: IGV_COLORS[i % len(IGV_COLORS)] for i, prov inenumerate(province_list_long)}
pointdfsf["color"] = pointdfsf["省"].map(color_map_long)
# 汇总每个省份的企业数量
provdf = pointdfsf.drop(columns="geometry").groupby(["省""省代码"]).size().reset_index(name="n")
provdf2 = provmap.merge(provdf, on=["省""省代码"], how="left")
provdf2["n"] = provdf2["n"].fillna(0).astype(int)

按分位数分组:

cutlist_raw = np.quantile(provdf2["n"].values, np.arange(19) / 8)
cutlist = [0] + sorted(set(cutlist_raw.astype(int).tolist()))
labels_p = ["<= 8""8~28""28~58""58~159",
"159~513""513~870""870~2459""> 2450"]
provdf3 = provdf2.copy()
provdf3["group"] = pd.cut(
    provdf3["n"], bins=cutlist,
    labels=labels_p[: len(cutlist) - 1],
    include_lowest=True
)
print(provdf3["group"].value_counts().sort_index())

然后绘制长版省级填充地图:

# 长版线条样式
LINE_COLOR_LONG = {"九段线""#A29AC4""海岸线""#0055AA"}
LINE_WIDTH_LONG = {"九段线": 0.6, "海岸线": 0.3}
# 离散色阶
n_cats = len(labels_p)
acton_colors_long = [CMAP_ACTON(i / (n_cats - 1) * 0.95) for i inrange(n_cats)]
cat_color_map_long = dict(zip(labels_p, acton_colors_long))
fig, ax = plt.subplots(figsize=(8, 9))
long_bbox_gdf.plot(ax=ax, color="#BBD1EB", zorder=1)
# 逐组绘制省份
forlabelin labels_p:
    subset = provdf3[provdf3["group"] == label]
if len(subset) > 0:
        subset.plot(
            ax=ax, facecolor=cat_color_map_long[label],
            edgecolor="gray", linewidth=0.01, zorder=2
        )
provdf3[provdf3["group"].isna()].plot(
    ax=ax, facecolor="white", edgecolor="gray", linewidth=0.01, zorder=2
)
china_neighboring_long.plot(ax=ax, facecolor="#EDEDED", edgecolor="none", zorder=3)
for _, row in china_neighboring_long.iterrows():
    centroid = row.geometry.centroid
    ax.text(
        centroid.x, centroid.y, row["country_cn"],
        fontsize=7, color="gray", ha="center", va="center",
        fontproperties=font_prop, zorder=6
    )
for cls in ["九段线""海岸线"]:
    subset = provlinemap[provlinemap["class"] == cls]
if len(subset) > 0:
        subset.plot(ax=ax, color=LINE_COLOR_LONG[cls], linewidth=LINE_WIDTH_LONG[cls], zorder=4)
ax.scatter(
    pointdfsf.geometry.x, pointdfsf.geometry.y,
    c=pointdfsf["color"], s=0.3, linewidths=0, zorder=5
)
ax.set_aspect("equal")
ax.set_xlim(long_bbox_gdf.total_bounds[0], long_bbox_gdf.total_bounds[2])
ax.set_ylim(long_bbox_gdf.total_bounds[1], long_bbox_gdf.total_bounds[3])
xlim = ax.get_xlim()
ylim = ax.get_ylim()
ax_w = xlim[1] - xlim[0]
ax_h = ylim[1] - ylim[0]
# 分类图例(左侧,下移到 0.12 位置,从上到下排列)
此处代码需下载讲义材料查看~

关键函数对照表

R(ggplot2 + sf)
Python(matplotlib + geopandas)
说明
st_bbox() %>% st_as_sfc()shapely.geometry.box()
创建矩形区域
read_sf()gpd.read_file()
读取 Shapefile
st_as_sf(coords, crs)gpd.points_from_xy() + GeoDataFrame(crs)
创建点要素
st_transform(crs)gdf.to_crs(crs)
坐标系转换
st_intersection()gdf.geometry.within()
空间裁剪(点在面内)
bind_rows()pd.concat()
合并数据框
geom_sf()gdf.plot()
绘制地图图层
annotation_scale()
手绘黑白矩形比例尺
比例尺
annotation_north_arrow()ax.annotate(arrowprops)
指北针
scale_fill_scico()plt.cm.get_cmap()
 + mcolors.LogNorm()
连续色阶
scale_fill_scico_d()pd.cut()
 + 逐组绘制
分段色阶
ggsave()plt.savefig()
保存图片

如何参加课程?

是不是感觉很硬核!欢迎报名 RStata 培训班获取全部课程和以会员价获取数据资料(10元/份)详情可阅读这篇推文:数据处理、图表绘制、效率分析与计量经济学如何学习~

详情可点击阅读原文进入 RStata 学院了解(从首页的会员卡专区即可查看和购买会员卡)。

更多关于 RStata 培训班的信息可添加微信号 r_stata2 咨询:

附件下载(点击文末的阅读原文即可跳转):

https://rstata.duanshu.com/#/brief/course/1295d878ae3442e7b38c67ce1c0be493

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 07:00:34 HTTP/2.0 GET : https://f.mffb.com.cn/a/489236.html
  2. 运行时间 : 0.251571s [ 吞吐率:3.98req/s ] 内存消耗:4,647.02kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=3263dafa43cc1e39cf2632aa6b296379
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000384s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000543s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.030402s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.004073s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000576s ]
  6. SELECT * FROM `set` [ RunTime:0.005999s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000603s ]
  8. SELECT * FROM `article` WHERE `id` = 489236 LIMIT 1 [ RunTime:0.006484s ]
  9. UPDATE `article` SET `lasttime` = 1783119635 WHERE `id` = 489236 [ RunTime:0.006226s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.001759s ]
  11. SELECT * FROM `article` WHERE `id` < 489236 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.017257s ]
  12. SELECT * FROM `article` WHERE `id` > 489236 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.011842s ]
  13. SELECT * FROM `article` WHERE `id` < 489236 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.059184s ]
  14. SELECT * FROM `article` WHERE `id` < 489236 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.018062s ]
  15. SELECT * FROM `article` WHERE `id` < 489236 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.017600s ]
0.253942s