where([ 'user_id' => $userId ])->find(); if ($user && $user['cert_no']) { $this->insert([ 'real_name' => $user['real_name'], 'cert_no' => $user['cert_no'], ]); } DatabaseRoute::getDb('tb_user', $userId, true)->where([ 'user_id' => $userId ])->update([ 'status' => 0 ]); } }