The explosions of mobile communications and the Internet of Things (IoT) have spawned a new distributed computing paradigm-spatial crowdsourcing, in which workers actively participate in spatiotemporal computing tasks for earning commissions, facilitating the development of urban sharing economic services. Furthermore, to reduce users' storage space and computational overhead, the server assignment model (SAM) is widely used, which means that crowdsourcing platforms collect sensitive information about tasks and workers, e.g., locations and interests, to perform task assignments accurately. However, in the real world, crowdsourcing platforms are not fully trustworthy and may reveal sensitive information about workers and tasks, which can reduce users' motivation to use crowdsourcing services. Therefore, how to assign tasks efficiently and securely is still an urgent problem to be solved. In this article, we propose a privacy-preserving task assignment scheme (PPTA), in which the crowdsourcing platform efficiently implements the nearest task assignments without revealing sensitive information about tasks and workers. In PPTA, we utilize inner product functional encryption to achieve circular range queries and multikeyword queries. Considering that workers usually prefer to query the nearest tasks for reducing travel costs, we use the grid location intersection to enable the nearest task assignment. In particular, we design a SAM algorithm, which can improve task assignment rates in multitask and multiworker scenarios. In addition, our scheme can implement user accountability and user revocation, which enhances the security and practicality of the scheme. Finally, we demonstrate the privacy preservation through security theoretical proofs and show the efficiency by constructing extensive comparative experiments, which respectively illustrate the security and the effectiveness of our scheme.