Adjusting for age, sex, CAP, BMI, sulfonylurea and thiazolidinedione usage, serum uric acid and HDL-C levels and AST and ALT activities in multivariate analysis, the results revealed that patients with older age (odds ratio (OR): 1.06, 95% confidence index (CI): 1.01–1.11), high BMI (OR: 1.14, 95% CI: 1.02–1.26), sulfonylurea usage (OR: 2.83, 95% CI: 1.22–6.57), and elevated AST activity (OR: 1.12, 95% CI: 1.05–1.19) had an increased risk of liver fibrosis in T2D patients with NAFLD. The gene discussed is GPT; the disease is Hepatic fibrosis.