An upconversion fluorescence biosensor was developed and employed in a self-designed cuvette engineered for the detection of Salmonella typhimurium and Staphylococcus aureus in chicken samples. The cuvette consisted of a hollow cylinder filled with alendronic acid-modified upconversion nanoparticles (ADA@UCNPs) and solid quartz cube blocks and could provide a stable and reusable fluorescent donor. In addition, the fluorescence inner filter mechanism (IEF) between two fluorescence quenchers (3,3′,5,5′-tetramethylbenzidine oxide (oxTMB) and 5-bromo-4-chloro-3-indolyl phosphate/nitroblue tetrazole (oxBCIP/NBT)) and ADA@UCNPs in the cuvette could be triggered. After sample injection, bacteria-targeting aptamers labeled with horseradish peroxidase (HRP) or alkaline phosphatase (AP) fell off the magnetic graphene oxide (MNPs@GO), resulting in the blockage of the enzymatic reaction. This led to an increase in the yellow-green upconversion fluorescence peaks at 547 nm and 658 nm. The whole detection process could be accomplished within 40 min and required the minimum amounts of ADA@UCNPs and MNPs@GO. The limit of detection was as low as 14 CFU/mL for Salmonella typhimurium and 33 CFU/mL for Staphylococcus aureus. To sum up, the upconversion fluorescence biosensor holds a potential in rapid analysis and detection of foodborne pathogenic bacteria.