find(); if (empty($user)) { page_result(1, "手机号不存在"); } page_result(0, '', [ 'nickname' => $user['nickname'], 'avatar' => $user['avatar'], ]); } public function dealIncomeByMobile() { $mobile = input('mobile'); $user = UserModel::where('mobile', $mobile)->find(); if (empty($user)) { page_result(1, "用户不存在"); } $balanceService = new BalanceService(); $balanceService->add($user['id'], BalanceService::SERVICE_SUCCESS); } }