A door lock includes a latch slideably received in a case and an unlocking mechanism mounted in the case and operatively connected to the latch for moving the latch between a latching position and an unlatching position. The unlocking mechanism includes an unlocking mechanism having a shaft for moving a locking member between a front position in which the unlocking mechanism is locked and a rear position in which the unlocking mechanism is not locked. The shaft can be driven by a motor through wired or wireless control to rotate in a forward direction or reverse direction for locking or unlocking purposes.